vb code that asks for file name, then saves to file works in word but not outlook
Posted on 2005-04-27
I have the following macro which works fine in word, and allows me to save a file automatically to a desired destination called "email DD/MM/YYYYY" but when I run this code in Outlook, it falls over both at ChangeFileOpenDirectory...... and then on the next line ActiveDocument.SaveAs FileName........
The code I have is as follows, I assume that the file should be saved as a .msg file rather than .doc file for outlook but this makes no diference to the running of this: -
' emailsave Macro
' Macro created 27/04/2005 by Andrew Paterson
Dim strFolderNumber As String
CurrentDate = Format(Date, "mm-dd-yy")
CurrentTime = Format(Now, "h.mm am/pm")
strFolderNumber = InputBox("Please enter file number.")
"\\Server1\files\" + strFolderNumber
ActiveDocument.SaveAs FileName:="Email" & " " & CurrentDate & " " & CurrentTime & " " & ".doc"