![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Thanks for taking the time to read my question.
I'd like to make a button on my tool bar in Outlook 2007 that will automatically save the selected e-mail to a predetermined folder. This is the code I have so far for my macro, but it doesn't work. I get the error Run-time error '91': Object variable or With block variable not set code: Public Sub ExportSAR() Dim TheEmail As MailItem Dim NewFileName As String NewFileName = InputBox("Enter the SaveAs name", "Save E-mail As", "SAR - Change - ") If NewFileName "" Then TheEmail.SaveAs "A:\2009\200907\" & NewFileName, olMSG Else MsgBox "No file name was entered. Operation aborted.", 64, "Cancel Operation" Exit Sub End If End Sub I can't figure out what I need to fix to make this work. Any help would be great. Thanks, Brad |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to save a email, sent out, as a file | DPM | Outlook and VBA | 4 | December 11th 07 05:46 AM |
mshtml.Help file is missing. Can't save E-Mail pictures. | Andy | Outlook Express | 10 | October 18th 07 03:02 AM |
How to automatic save file and forward mail? | Mesak | Outlook and VBA | 1 | July 26th 07 03:54 PM |
outlook 2k3 Script: how to Save Mail body to txt file | news.microsoft.com | Outlook and VBA | 5 | November 7th 06 02:23 PM |
trying to save as .msg file !! | WhytheQ | Outlook and VBA | 2 | May 26th 06 01:32 PM |