mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Retrying export to word if it fails... usually this is due to the error "COM object that has been separated from its underlying RCW cannot be used."
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1901 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
3e761d929e
commit
fba0624364
1 changed files with 22 additions and 2 deletions
|
@ -119,7 +119,17 @@ namespace Greenshot.Destinations {
|
|||
}
|
||||
}
|
||||
if (documentCaption != null) {
|
||||
WordExporter.InsertIntoExistingDocument(documentCaption, tmpFile);
|
||||
try {
|
||||
WordExporter.InsertIntoExistingDocument(documentCaption, tmpFile);
|
||||
} catch (Exception) {
|
||||
try {
|
||||
WordExporter.InsertIntoExistingDocument(documentCaption, tmpFile);
|
||||
} catch (Exception ex) {
|
||||
LOG.Error(ex);
|
||||
surface.SendMessageEvent(this, SurfaceMessageTyp.Error, Language.GetFormattedString("destination_exportfailed", Description));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!manuallyInitiated) {
|
||||
List<string> documents = WordExporter.GetWordDocuments();
|
||||
|
@ -134,7 +144,17 @@ namespace Greenshot.Destinations {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
WordExporter.InsertIntoNewDocument(tmpFile);
|
||||
try {
|
||||
WordExporter.InsertIntoNewDocument(tmpFile);
|
||||
} catch(Exception) {
|
||||
try {
|
||||
WordExporter.InsertIntoNewDocument(tmpFile);
|
||||
} catch (Exception ex) {
|
||||
LOG.Error(ex);
|
||||
surface.SendMessageEvent(this, SurfaceMessageTyp.Error, Language.GetFormattedString("destination_exportfailed", Description));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
surface.SendMessageEvent(this, SurfaceMessageTyp.Info, Language.GetFormattedString(LangKey.exported_to, Description));
|
||||
surface.Modified = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue