gpt4 book ai didi

excel - 从 Excel 回复 Outlook 邮件

转载 作者:行者123 更新时间:2023-12-04 20:43:43 24 4
gpt4 key购买 nike

我正在尝试使用正文中的给定格式“回复所有”。

我使用以下代码来搜索和显示邮件。

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 触发。

最佳答案

由于您使用的是早期绑定(bind),因此更改

Dim olMail As Variant


Dim olMail As Outlook.MailItem

然后您将能够访问 olMail 的所有属性。元素。其中之一是 .ReplyAll
截图

enter image description here
If InStr(olMail.Subject, "Blah Blah") <> 0 Then
olMail.Display
olMail.ReplyAll

DoEvents

'
'~~> Rest of the code
'

i = i + 1
End If

关于excel - 从 Excel 回复 Outlook 邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25238635/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com