(Solved) – Create PDF File, Attach in Out

  • by

Please help.

My code below should do the following:

1.Save Sheet1 as a PDF file. No problems here

2.Outlook should get the recently saved PDF file and attach in new mail ready to send.

Thanks in advance,


I am using MSoffice 2013

Sub Create_PDF_Attach_In_outlook_And_Send ()

    Dim outlookOBJ As Object
    Dim mItem As Object
    Set outlookOBJ = CreateObject("outlook.application")
    Set mItem = outlookOBJ.CreateItem(olMailItem)

    Sheet1.ExportAsFixedFormat Type:=xlTypePDF, _
    IgnorePrintAreas:=False, _
    OpenAfterPublish:=True, _

    With mItem
    .To = Sheet1.Range("O8").Value
    .CC = Sheet1.Range("O9").Value
    .Subject = Filename
    .Attachments.Add **????**
    .Body = "Enter Body Text"

    End With

    Set outlookOBJ = Nothing
    Set mItem = Nothing

End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *