Fixed issue with exporting to plain text mails. Now the screenshot is attached, before it was "in line" if outlook >=2007 was used BUT when sending a popup was shown.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1829 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-05-03 10:16:19 +00:00
commit 544d3ee158

View file

@ -180,7 +180,8 @@ namespace Greenshot.Interop.Office {
// Make sure the inspector is activated, only this way the word editor is active! // Make sure the inspector is activated, only this way the word editor is active!
// This also ensures that the window is visible! // This also ensures that the window is visible!
inspector.Activate(); inspector.Activate();
bool isTextFormat = OlBodyFormat.olFormatPlain.Equals(mailItem.BodyFormat);
if (isAppointment || !isTextFormat) {
// Check for wordmail, if so use the wordexporter // Check for wordmail, if so use the wordexporter
// http://msdn.microsoft.com/en-us/library/dd492012%28v=office.12%29.aspx // http://msdn.microsoft.com/en-us/library/dd492012%28v=office.12%29.aspx
// Earlier versions of Outlook also supported an Inspector.HTMLEditor object property, but since Internet Explorer is no longer the rendering engine for HTML messages and posts, HTMLEditor is no longer supported. // Earlier versions of Outlook also supported an Inspector.HTMLEditor object property, but since Internet Explorer is no longer the rendering engine for HTML messages and posts, HTMLEditor is no longer supported.
@ -199,7 +200,8 @@ namespace Greenshot.Interop.Office {
LOG.Info("Can't export to an appointment if no word editor is used"); LOG.Info("Can't export to an appointment if no word editor is used");
return false; return false;
} else { } else {
LOG.Info("Trying export for word < 2007."); LOG.Info("Trying export for outlook < 2007.");
}
} }
// Only use mailitem as it should be filled!! // Only use mailitem as it should be filled!!
LOG.InfoFormat("Item '{0}' has format: {1}", mailItem.Subject, mailItem.BodyFormat); LOG.InfoFormat("Item '{0}' has format: {1}", mailItem.Subject, mailItem.BodyFormat);