Attaching file and info in body of anopened email. i.e. Replying to email

Share your favorite FastKeys commands
Post Reply
jcfastkeys
Posts: 8
Joined: Sep 4th, ’21, 23:26

Post by jcfastkeys » Sep 15th, ’21, 00:02

How would I change this script if I do not want to create a new email but attach a file and enter info in the body of an existing email?
Thanks

FilePath:= A_Desktop "\myfile.txt"
if not FileExist(FilePath)
msgbox % FilePath "`nDOES NOT EXIST"
else
{
oOutlook:=ComObjCreate("Outlook.Application").CreateItem(0)
oOutlook.Subject:="Attachment"
oOutlook.To:="[email protected]"
oOutlook.Body:="Please find attached..."
oOutlook.Attachments.Add(FilePath)
oOutlook.Display
}
return
Post Reply