I am trying to create a macro that will automatically save a copy of and email the current workbook. I don't want to use the .SendTo meathod because I want the user to have the opportunity to type a message or attach multiple items. I can open a blank mail form, add in recipients and subjects (thanks to a little lot of help) but I cannot attach files to it. Can anyone show me what I am doing wrong?
Definitions:
wbBookToMail: an excel workbook variable
Recipients: A variable to hold the mail recipients
TempFileName, TempFilePath, FileExtStr: variables to hold the different parts of the filename
FileFormatNum: A variable that defines the format of the file
-JTBorton
Another Day, Another Disaster
Definitions:
wbBookToMail: an excel workbook variable
Recipients: A variable to hold the mail recipients
TempFileName, TempFilePath, FileExtStr: variables to hold the different parts of the filename
FileFormatNum: A variable that defines the format of the file
Code:
[COLOR=darkblue]With[/color] wbBookToMail
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormat:=FileFormatNum
[COLOR=green]'On Error Resume Next[/color]
CreateObject("WScript.Shell").Run "mailto:" & Recipients & "?subject=Test&attachment=" & TempFilePath & TempFileName & FileExtStr
[COLOR=darkblue]On Error GoTo[/color] 0
[COLOR=darkblue]End With[/color]
-JTBorton
Another Day, Another Disaster