mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 05:53:27 -07:00
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:
parent
7d97758d3e
commit
544d3ee158
1 changed files with 20 additions and 18 deletions
|
@ -180,26 +180,28 @@ namespace Greenshot.Interop.Office {
|
|||
// Make sure the inspector is activated, only this way the word editor is active!
|
||||
// This also ensures that the window is visible!
|
||||
inspector.Activate();
|
||||
bool isTextFormat = OlBodyFormat.olFormatPlain.Equals(mailItem.BodyFormat);
|
||||
if (isAppointment || !isTextFormat) {
|
||||
// Check for wordmail, if so use the wordexporter
|
||||
// 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.
|
||||
if (inspector.IsWordMail() && inspector.WordEditor != null) {
|
||||
if (WordExporter.InsertIntoExistingDocument(inspector.WordEditor, tmpFile)) {
|
||||
LOG.Info("Inserted into Wordmail");
|
||||
|
||||
// Check for wordmail, if so use the wordexporter
|
||||
// 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.
|
||||
if (inspector.IsWordMail() && inspector.WordEditor != null) {
|
||||
if (WordExporter.InsertIntoExistingDocument(inspector.WordEditor, tmpFile)) {
|
||||
LOG.Info("Inserted into Wordmail");
|
||||
|
||||
// check the format afterwards, otherwise we lose the selection
|
||||
//if (!OlBodyFormat.olFormatHTML.Equals(currentMail.BodyFormat)) {
|
||||
// LOG.Info("Changing format to HTML.");
|
||||
// currentMail.BodyFormat = OlBodyFormat.olFormatHTML;
|
||||
//}
|
||||
return true;
|
||||
// check the format afterwards, otherwise we lose the selection
|
||||
//if (!OlBodyFormat.olFormatHTML.Equals(currentMail.BodyFormat)) {
|
||||
// LOG.Info("Changing format to HTML.");
|
||||
// currentMail.BodyFormat = OlBodyFormat.olFormatHTML;
|
||||
//}
|
||||
return true;
|
||||
}
|
||||
} else if (isAppointment) {
|
||||
LOG.Info("Can't export to an appointment if no word editor is used");
|
||||
return false;
|
||||
} else {
|
||||
LOG.Info("Trying export for outlook < 2007.");
|
||||
}
|
||||
} else if (isAppointment) {
|
||||
LOG.Info("Can't export to an appointment if no word editor is used");
|
||||
return false;
|
||||
} else {
|
||||
LOG.Info("Trying export for word < 2007.");
|
||||
}
|
||||
// Only use mailitem as it should be filled!!
|
||||
LOG.InfoFormat("Item '{0}' has format: {1}", mailItem.Subject, mailItem.BodyFormat);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue