从Excel回复Outlook邮件 [英] Reply to Outlook mail from Excel

查看:158
本文介绍了从Excel回复Outlook邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在正文中使用给定格式全部回复".

I am trying to "replytoall" with a given format in the Body.

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

I use the following code to search for and display the mails.

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

我需要以相同的主题以及规定的机构和签名来回答所有问题.

I need to Replyall with the same subject and a prescribed body and signature.

这类似于我们在Outlook中打开邮件并单击全部答复"按钮.

It is similar to when we open up a mail in Outlook and click on the Reply to All button.

我希望它是从Excel触发的.

I want it triggered from Excel.

推荐答案

由于您使用的是早期绑定,请更改

Since you are using Early Binding, Change

Dim olMail As Variant

Dim olMail As Outlook.MailItem

然后您将可以访问olMail项的所有属性.其中之一是.ReplyAll

And then you will be able to access all the properties of the olMail item. One of which is .ReplyAll

ScreenShot

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

    DoEvents

    '
    '~~> Rest of the code
    '

    i = i + 1
End If

这篇关于从Excel回复Outlook邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆