我正在尝试以正文中给定的格式“回复所有”。
我使用以下代码来搜索并显示邮件。
Sub Test()
Dim olApp As Outlook.Application
Dim olNs As Namespace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim i As Integer
Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.GetDefaultFolder(olFolderInbox)
i = 1
For Each olMail In Fldr.Items
If InStr(olMail.Subject, "Application for Privilege Leave - Leave ID - Dev-PL-45252-4") <> 0 Then
olMail.Display
i = i + 1
End If
Next olMail
End Sub
我需要使用相同的主题以及规定的正文和签名来回复所有内容。
这类似于我们在 Outlook 中打开邮件并单击“回复全部”按钮。
我希望它从 Excel 触发。
由于您使用的是早期绑定,因此请更改
Dim olMail As Variant
to
Dim olMail As Outlook.MailItem
然后您将能够访问该对象的所有属性olMail
物品。其中之一是.ReplyAll
截屏
If InStr(olMail.Subject, "Blah Blah") <> 0 Then
olMail.Display
olMail.ReplyAll
DoEvents
'
'~~> Rest of the code
'
i = i + 1
End If
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)