【发布时间】:2016-02-05 07:27:34
【问题描述】:
使用电子邮件规则触发 VBA 脚本,是否可以将电子邮件正文发送到剪贴板?我找到了这个method,但它似乎不起作用。
Sub SaveToClipboard(Item As Outlook.MailItem)
Dim Explorer As Outlook.Explorer
Dim oitem As Outlook.MailItem
Dim oData As MSForms.DataObject
Set Explorer = Application.ActiveExplorer
If Explorer.Selection.Count Then
Set CurrentItem = Explorer.Selection(1)
Set oitem = CurrentItem
oData = oitem.Body
oData.PutInClipboard
'Using this to test the output
MsgBox oData
End If
End Sub
然后,我将如何在电子邮件正文中搜索以“信息:”开头的行并仅将该行复制到剪贴板?
【问题讨论】:
-
每个线程只有一个问题。首先搜索“vba 结构化文本”之类的内容,如有必要,在整理一些代码后开始一个新问题。