Macro help to shorten "Save As" for emails

L

lynxwoman

In a perfect world I would be able to create a macro that
looks at an email (like a rule does) and "Save As" to a
file folder on our server (not an exchange folder). I've
done a search in this newsgroup to no avail. One person
asked but they were using Express.

I have Outlook 2003. Any suggestions, code you can share
or links you can recommend?

Thanks to all.

[email protected]
 
S

Sue Mosher [MVP-Outlook]

At its most basic, a VBA procedure you could run as a rule action in Outlook
2002 or 2003 to save the message as an .msg file could be:

Public Sub SaveAsSomething(MyMail as MailItem)
Dim strPath
strPath = "Z:\SharedFolder\"
MyMail.SaveAs strPath & MyMail.Subject, olMsg
End Sub

To do it right, though, you'd want to check for the existence of a file with
the same name before you save and come up with some scheme for making the
file names unique. You'd also need to strip characters that can't be used in
file names but can be used in message subjects. (HINT: Use Replace())

FYI, there is a newsgroup specifically for general Outlook programming
issues "down the hall" at microsoft.public.outlook.program_vba or, via web
interface, at
http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.outlook.program_vba
 
Top