Save mail on harddrive

S

Solander

I wish to create a macro that will save the currently opened mail to a
specified folder on the harddrive.

The plan is to create a custom toolbar-button that will execute the code
saving the mail.

How do I do this ?

Regards,
Solander
 
K

Ken Slovak - [MVP - Outlook]

Sub SaveOpenItem()
Dim oMail As Outlook.MailItem

Set oMail = Application.ActiveInspector.CurrentItem
oMail.SaveAs path, type
Set oMail = Nothing
End Sub

You will need to code or get the path as a string and you need to set
the type. See the Help in the Object Browser for MailItem.SaveAs to
see what types are supported.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top