Outlook messages generated from Excel macro

C

Condor

I have an Excel macro I use to run weekly reports for 30 or so employees in
my office. The macro saves each employee's report as a separate workbook,
attaches it to an Outlook e-mail, and e-mails it to that employee. I've
been doing this for a while now without any trouble.

After (or before, I don't care) I send each e-mail, I would like to save the
e-mail to a folder on my harddrive as an Outlook file (file type *.msg),
e.g., Sue's Weekly Report.msg. I searched this newsgroup's archive on
Google for code I could use but did not find anything.

So, my question is, can anyone tell me what code to add to my VBA e-mail
procedure to save an Outlook e-mail to my hardrive?


Condor
 
B

Bernie Deitrick

Condor,

With the mail item object, just use something like

myItem.SaveAs "C:\Folder\" & strFilename & ".msg"
myItem.Send

Outlook should also save a copy in the sent item folder, if you have that option set.

HTH,
Bernie
MS Excel MVP
 
C

Condor

Thank you. That was very helpful.


Condor


Bernie Deitrick said:
Condor,

With the mail item object, just use something like

myItem.SaveAs "C:\Folder\" & strFilename & ".msg"
myItem.Send

Outlook should also save a copy in the sent item folder, if you have that
option set.

HTH,
Bernie
MS Excel MVP
 

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