【发布时间】:2019-02-04 21:39:04
【问题描述】:
在 MS Outlook 中,我想遍历每封选定的电子邮件,对于每封电子邮件,查看源代码并检查源文件(如 txt 格式)是否包含某个字符串“XX”。由于使用查看源代码可以将电子邮件内容显示为 html 格式,因此我想跟踪一些文本中存在问题的格式。
目前我是手动打开邮件,右键>查看源>Ctrl+F找到我要找的字符串。
有没有视图可以用VBA做邮件中“查看源代码”的动作?
Dim individualItem As Object
For Each individualItem In Application.ActiveExplorer.Selection
'View Source Code of the email
'Find "XX" in the email body content
If Instr(individualItem.body, "XX") = 1 Then
Msgbox ("Find string!")
End if
Next Message
谢谢。
【问题讨论】:
-
邮件正文中没有的源代码是什么?