Activation (display) fixes for Outlook/Word

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2580 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2013-04-22 14:52:10 +00:00
commit 55f52bd658
2 changed files with 18 additions and 2 deletions

View file

@ -283,6 +283,12 @@ namespace Greenshot.Interop.Office {
LOG.WarnFormat("Problem while trying to add attachment to Item '{0}' : {1}", inspector.Caption, ex);
return false;
}
try {
inspector.Activate();
} catch (Exception ex) {
LOG.Warn("Problem activating inspector: ", ex);
return false;
}
LOG.Debug("Finished!");
return true;
}

View file

@ -142,8 +142,18 @@ namespace Greenshot.Interop.Office {
}
}
}
wordDocument.Activate();
wordDocument.ActiveWindow.Activate();
try {
wordApplication.Activate();
} catch {
}
try {
wordDocument.Activate();
} catch {
}
try {
wordDocument.ActiveWindow.Activate();
} catch {
}
}
}
}