How Do I attach a atachment to a VBA created email?

D

Dan Gardner

I’ve created an outlook email in a macro using the following code;

'Control Microsoft Outlook and create a new Email
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
myItem.To = Worksheets("Sheet1").Cells(2, 17).Value
'Assign a Subject to the Email
myItem.Subject = Worksheets("Sheet1").Cells(1, 1).Value
'Attach File to Mesage
myItem.body = ???????

'Send the Email
myItem.Send

As you can see I can't seam to figure out the Attach file command. Any help
would be greatly appreciated.

Thanks,
Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top