Attach a File in Outlook E-Mail

Discussion, questions and support.
Post Reply
kamlismit
Posts: 7
Joined: Aug 6th, ’21, 12:21

Post by kamlismit » Aug 9th, ’21, 13:38

Is there a way to Attach a File in Outlook E-Mail by using textexpander or Shortcut?
User avatar
Tom
Posts: 791
Joined: Nov 24th, ’15, 23:39

Post by Tom » Aug 9th, ’21, 16:40

Try this (Type: Command):

Code: Select all

m:=ComObjCreate("Outlook.Application").CreateItem(0)
m.Subject:="Attachment"
m.To:="[email protected]"
m.Body:="Please find attached..."
m.Attachments.Add("D:\MyFile.txt")
m.Display
m:=""
kamlismit
Posts: 7
Joined: Aug 6th, ’21, 12:21

Post by kamlismit » Aug 10th, ’21, 07:32

Thank you, Tom, for sharing this code.

This code helps me to draft a new email every time I type the textexpander text. It works perfectly if I want to draft a new mail every time with the same preferences.

But, my purpose is different. Let me brief you.

I need to share just an attachment (for example a company profile) from a different email.
So I draft the email and attach the pdf file.

Every time the file remains the same which I need to attach. So I just need to create a shorthand to attach/paste the file.

I don't want to create a new email.
User avatar
Tom
Posts: 791
Joined: Nov 24th, ’15, 23:39

Post by Tom » Aug 12th, ’21, 16:21

Then you can simply copy the file and paste it to the mail. :?:
Post Reply