我正在尝试根据一封电子邮件撰写一封电子邮件,该电子邮件当前已在我的收件箱中打开。我在this URL下找到了一些来源,但是由于oInspector
是Nothing
,所以整个工作都无法正常工作(实际上,oInspector
似乎仅在转发时被填充并弹出电子邮件)。
这里是我所指的源代码:
Dim myText As String
myText = "Hello world"
Dim NewMail As MailItem, oInspector As Inspector
Set oInspector = Application.ActiveInspector
If oInspector Is Nothing Then ' <== indeed, this seems to be Nothing
MsgBox "No active inspector"
Else
Set NewMail = oInspector.CurrentItem
If NewMail.Sent Then
MsgBox "This is not an editable email"
Else
If oInspector.IsWordMail Then