将表情符号插入电子邮件正文“弹出”电子邮件可以正常工作

时间:2018-08-29 15:27:56

标签: excel excel-vba outlook outlook-vba

但是我该如何编辑写在应用程序内部的电子邮件,又不是“弹出”呢?

Private Sub TransferToEmail(picControl)
On Error GoTo Delete

    Dim pictureFilePath As String
        pictureFilePath = "Z:\tempPic"

    SavePicture picControl.picture, pictureFilePath

    Dim olApp As Outlook.Application
        Set olApp = GetObject(, "Outlook.Application")

    Dim objDoc As Word.Document
        Set objDoc = olApp.ActiveInspector.WordEditor

    Dim objselect As Word.Selection
        Set objselect = objDoc.Windows(1).Selection

    objselect.InlineShapes.AddPicture pictureFilePath
Delete:
    Dim fso As Object
        Set fso = CreateObject("scripting.filesystemobject")
    If fso.fileexists(pictureFilePath) Then fso.deletefile ("" & pictureFilePath & "")
End Sub

当我弹出窗口时,此方法有效,但是当处理应用程序本身“内部”的新邮件项目时,此方法无效

1 个答案:

答案 0 :(得分:1)

对于内联响应,请使用Explorer.ActiveInlineResponse / ActiveInlineResponseWordEditor属性和Explorer.InlineResponse / InlineResponseClose事件。 用OutlookSpy查看对象,以查看Outlook对象模型中可用的对象。