Outlook - 以编程方式修改当前正在 composed/edited 的电子邮件
Outlook - programmatically modify email currently being composed/edited
出于正当的个人原因**我正在尝试构建一个宏来清除要回复的电子邮件的收件人、抄送、主题和正文(在撰写模式下?)。我下面的内容适用于正在阅读的电子邮件,但不适用于 MODIFIED/COMPOSED.
的电子邮件
要使宏在 composed/edited 的电子邮件上工作,必须更改什么?
Sub ClearEmail()
Dim olExplorer As Explorer
Dim olSelection As Selection
Dim email As MailItem
Dim strSig As String, Sig As String
Set olExplorer = Application.ActiveExplorer
Set olSelection = olExplorer.Selection
Set email = olSelection.Item(1)
email.To = ""
email.CC = "team@example.com"
email.Subject = ""
email.HTMLBody = vbCrLf & vbCrLf & vbCrLf & "Hello"
End Sub
** 我的 Exchange 配置文件乱七八糟,已经好几个星期了,兼职 Exchange 管理员无法访问它很快。我可以成功发送电子邮件的唯一方法是打开群组收件箱中的现有电子邮件,点击回复所有人,清除字段并添加我的签名。然后我可以根据需要进行编辑并毫无问题地发送。 (我只是简单地撰写和发送的电子邮件卡在发件箱中,永远不会发送 - 有几十封。)我已经手动这样做了几个星期。
我不是Outlook/VBA程序员所以请原谅我不知道正确的术语。
来源:
http://www.rondebruin.nl/win/s1/outlook/signature.htm
http://www.vbforums.com/showthread.php?628044-Insert-text-into-current-outlook-message
这允许编辑当前正在撰写的电子邮件:
Dim theEmail As MailItem, oInspector As Inspector
Set oInspector = Application.ActiveInspector
Set theEmail = oInspector.CurrentItem
参考:
Working with current open email
出于正当的个人原因**我正在尝试构建一个宏来清除要回复的电子邮件的收件人、抄送、主题和正文(在撰写模式下?)。我下面的内容适用于正在阅读的电子邮件,但不适用于 MODIFIED/COMPOSED.
的电子邮件要使宏在 composed/edited 的电子邮件上工作,必须更改什么?
Sub ClearEmail()
Dim olExplorer As Explorer
Dim olSelection As Selection
Dim email As MailItem
Dim strSig As String, Sig As String
Set olExplorer = Application.ActiveExplorer
Set olSelection = olExplorer.Selection
Set email = olSelection.Item(1)
email.To = ""
email.CC = "team@example.com"
email.Subject = ""
email.HTMLBody = vbCrLf & vbCrLf & vbCrLf & "Hello"
End Sub
** 我的 Exchange 配置文件乱七八糟,已经好几个星期了,兼职 Exchange 管理员无法访问它很快。我可以成功发送电子邮件的唯一方法是打开群组收件箱中的现有电子邮件,点击回复所有人,清除字段并添加我的签名。然后我可以根据需要进行编辑并毫无问题地发送。 (我只是简单地撰写和发送的电子邮件卡在发件箱中,永远不会发送 - 有几十封。)我已经手动这样做了几个星期。
我不是Outlook/VBA程序员所以请原谅我不知道正确的术语。
来源:
http://www.rondebruin.nl/win/s1/outlook/signature.htm
http://www.vbforums.com/showthread.php?628044-Insert-text-into-current-outlook-message
这允许编辑当前正在撰写的电子邮件:
Dim theEmail As MailItem, oInspector As Inspector
Set oInspector = Application.ActiveInspector
Set theEmail = oInspector.CurrentItem
参考:
Working with current open email