可点击嵌入PDF

时间:2017-06-21 16:58:38

标签: vba outlook outlook-vba

我正在尝试在电子邮件正文中嵌入可点击的PDF。

此代码确实在电子邮件正文中嵌入了PDF,但是当我双击图像时,PDF文件无法打开。

无论如何我有可点击的图片吗?

Public Sub InsetObject()
    Dim Inspector As Outlook.Inspector
    Dim wdDoc As Word.Document
    Dim Selection As Word.Selection
    Dim Email As Outlook.MailItem
    Dim LinkToFile As Object


    Set Email = Application.CreateItem(olMailItem)

    With Email
        .To = "XXX@XXXXX.com"
        .Subject = "XXX Dashboard"
        .Attachments.Add ("C:\Work\Daily Dashboard.pdf")
        .Display

         Set Inspector = Application.ActiveInspector()
         Set wdDoc = Inspector.WordEditor
         Set Selection = wdDoc.Application.Selection

         Selection.InlineShapes.AddOLEObject ClassType:="AcroExch.Document.11", _
                   FileName:="C:\Work\Daily Dashboard.pdf", _
                   LinkToFile:=False, DisplayAsIcon:=False

        .Send

    End With

    Set Inspector = Nothing
    Set wdDoc = Nothing
    Set Selection = Nothing
End Sub

0 个答案:

没有答案