'c# VSTO How to save email in ActiveInlineResponse
I have simple problem, but dont know how to figure out.
My VSTO addon use Outlook for create new email. But email which user fill in the Application Outlook isnt sended,firstly email is modified and sended via C#.
My problem is how save this email which isnt sended via user, but c#.
Save email in Inspector
works
inspector = Globals.ThisAddIn.Application.ActiveInspector();
Outlook.MailItem mi = inspector.CurrentItem as Outlook.MailItem;
mi.Save();
Problem is explorer
.
User open email only one-clicked, pop-up windows inst opened and user stay in explorer. When he hit reply, in Outlook is email marked as Draft
.
How can this type of email be saved (just need change status Draft
to normal, after button Send
is fired.)
Explorer explorer = Globals.ThisAddIn.Application.ActiveExplorer();
MailItem item = explorer.ActiveInlineResponse;
item.Save();
Thanks for tips
Solution 1:[1]
The earliest you can access a message in the sent state is when the Items.ItemAdd
event fires on the Sent Items folder. At that point all sender related properties will be populated as well.
Note that you can change the sent flag of an MSG file - for a message in a store, that bit can be flipped only before the message is saved for the very first time (that is why MailItem.Sent
property in OOM is read-only). But that limitation does not apply to MSG files). If using Redemption (I am its author) is an option, you can use something like the following to make an MSG file appear sent:
Redemption.RDOSession session = new Redemption.RDOSession();
Redemption.RDOMail msg = session.GetMesageFromMsgFile(@"c:\temp\file.msg");
msg.Sent = true;
msg.Save();
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |