可以决定模板、添加其他收件人、编辑主题行的宏

可以决定模板、添加其他收件人、编辑主题行的宏

我是 VBA 新手,我想创建一个 Outlook 宏,该宏可以根据“收件人”字段决定使用哪个模板,向“抄送”和“密件抄送”字段添加特定收件人,向现有主题添加字符串(例如“example_subject”-->“confirmation\example_subject”)。

我的努力取得了以下成果:

Sub PO_confirmation()

    Dim myItem As Outlook.mailItem

    Dim recipients As Outlook.recipients
    Dim recipientTo As Outlook.recipient
    Dim recipientCC As Outlook.recipient
    Dim recipientBCC As Outlook.recipient

    Set myItem = ActiveInspector.CurrentItem


    Set recipientTo = myItem.recipients.Add("[email protected]")
    recipientTo.Type = Outlook.OlMailRecipientType.olTo

    Set recipientCC = myItem.recipients.Add("[email protected]")
    recipientCC.Type = Outlook.OlMailRecipientType.olCC

    Set recipientBCC = myItem.recipients.Add("[email protected]")
    recipientBCC.Type = Outlook.OlMailRecipientType.olBCC

    initialSubj = myItem.Subject
    myItem.Subject = "RE:ABC-" & initialSubj

    myItem.Display

End Sub

现在的问题是密件抄送收件人总是出现在收件人字段中,我不知道出了什么问题?

相关内容