0

我有宏将带有原始附件的电子邮件转发给原始电子邮件链中涉及的每个人。

    Sub my_test()

Dim objItem As Object

Dim mail As MailItem
Dim forwardMail As MailItem

Dim templateItem As MailItem

For Each objItem In ActiveExplorer.Selection

    If objItem.Class = olMail Then
    
        Set mail = objItem
        Set forwardMail = mail.Forward
        
        Set templateItem = CreateItemFromTemplate("C:\template.oft")
        
        With forwardMail
            .HTMLBody = templateItem.HTMLBody & .HTMLBody
            .To = mail.replyall.To & mail.replyall.CC
            .Display
        End With
        
    End If
    
Next

End Sub

是否可以将此电子邮件标记为“已回复”而不是“转发”电子邮件?

4

2 回答 2

0

是的,您只需更改 Set forwardMail = mail.ForwardSet forwardMail = mail.Reply

您还应该将变量名称更改forwardMail replyMail并更改代码中的所有变量。完整代码如下。

Sub my_test()

Dim objItem As Object
Dim mail As MailItem
Dim replyMail As MailItem
Dim templateItem As MailItem

For Each objItem In ActiveExplorer.Selection

If objItem.Class = olMail Then

    Set mail = objItem
    Set replyMail = mail.Reply
    
    Set templateItem = CreateItemFromTemplate("C:\template.oft")
    
    With replyMail
        .HTMLBody = templateItem.HTMLBody & .HTMLBody
        .To = mail.replyall.To & mail.replyall.CC
        .Display
    End With
    
 End If

Next

End Sub
于 2021-02-11T20:12:15.457 回答
0

如果您的意思是要将图标更改为代表“已回复”的图标,则可以通过以下方式进行更改...

' Set property PR_ICON_INDEX to 261
objItem.PropertyAccessor.SetProperty "http://schemas.microsoft.com/mapi/proptag/0x10800003", 261
objItem.Save
于 2021-02-15T12:00:34.287 回答