7
78.sergey
Hi All
I am new to this Outlook development through VSTO and needed a quick
clarification.
I am creating new emails in my app (using VSTO & C#) programatically
and am able to do that but was not sure if this is the best way to do
it:
Here is what I do:
public Outlook.MAPIFolder outBoxfolder;
outBoxfolder =
app.GetNamespace("MAPI").GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderOutbox);
Outlook.MailItem newMailItem =
(Outlook.MailItem)filter.outBoxfolder.Items.Add(Outlook.OlItemType.olMailItem);
newMailItem.Subject = mycopiedItem.Subject + " (Please treat this as
Private)";
newMailItem.To = "aaa.hotmail.com";
newMailItem.CC = string.Empty;
newMailItem.BCC = string.Empty;
The above code works but Please let me know if there is a better way
to create new emails.
I am new to this Outlook development through VSTO and needed a quick
clarification.
I am creating new emails in my app (using VSTO & C#) programatically
and am able to do that but was not sure if this is the best way to do
it:
Here is what I do:
public Outlook.MAPIFolder outBoxfolder;
outBoxfolder =
app.GetNamespace("MAPI").GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderOutbox);
Outlook.MailItem newMailItem =
(Outlook.MailItem)filter.outBoxfolder.Items.Add(Outlook.OlItemType.olMailItem);
newMailItem.Subject = mycopiedItem.Subject + " (Please treat this as
Private)";
newMailItem.To = "aaa.hotmail.com";
newMailItem.CC = string.Empty;
newMailItem.BCC = string.Empty;
The above code works but Please let me know if there is a better way
to create new emails.