outlook help

Add-in Express™ Support Service
That's what is more important than anything else

outlook help
help to save currently selected item 
Thomas Thomas




Posts: 17
Joined: 2006-09-12
Hi All,

I want to save currently selected mail item through my plugin.
I tried cant find class that gives me option to save.

What I want to achieve is to automate the File -> Save As.. option .
so that I can save the currently selected item (eg file " RE Add-in Express com feedback.msg")

I have the outlook object.

else if (application is Outlook.Application)
{
outlookApp = (Outlook.Application)application;
wordApp = null;
excelApp = null;
System.Windows.Forms.MessageBox.Show("u in oulook application");
}


thanks
Thomas
Posted 28 Sep, 2006 18:51:58 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Thomas.

You can use the SaveAs method of the Outlook._MailItem interface.
E.g.
olMailItem.SaveAs("<Path>", Outlook.OlSaveAsType.olMSG);
Posted 29 Sep, 2006 16:03:08 Top
Thomas Thomas




Posts: 17
Joined: 2006-09-12
Hi Sergey,

do u mean to use..
Outlook._MailItem oMailItem = (Outlook._MailItem)outlookApp.CreateItem(Outlook.OlItemType.olMailItem);
oMailItem.SaveAs("C:\test.msg", Outlook.OlSaveAsType.olMSG);
this doesnt give back the currently selected item which is no surprise..
so this giving me the error
"Exception Target Site: Object reference not set to an instance of an object."

what I want is the currently selected item by the outlook user and save to a location. Any idea how I can find that in outlook app.
I am trying to save that selected message to back up location.

Thanks
Thomas
Posted 01 Oct, 2006 16:20:38 Top
Thomas Thomas




Posts: 17
Joined: 2006-09-12
Hi Sergey,

it looks like

Outlook.Selection is what I was looking for ..


Thanks
Thomas
Posted 01 Oct, 2006 18:22:59 Top
Thomas Thomas




Posts: 17
Joined: 2006-09-12
Hi,

I found this link very useful

http://msdn2.microsoft.com/en-us/library/ms268994.aspx

Thanks
Thomas
Posted 02 Oct, 2006 23:08:48 Top