1
Private Sub inspectors_NewInspector(ByVal Inspector As Microsoft.Office.Interop.Outlook.Inspector) Handles inspectors.NewInspector
Dim mailItem As Outlook.MailItem = TryCast(Inspector.CurrentItem, Outlook.MailItem)
If Not (mailItem Is Nothing) Then
If mailItem.EntryID Is Nothing Then
mailItem.Subject = "Test"
mailItem.HTMLBody = mailItem.HTMLBody + "<html><img src='http://example.com/pixel.php></html>"
End If
End If
End Sub
上述工作正常。但是当我尝试向图像添加一些变量时,出现以下错误vba外观嵌入图像变量
错误!文件名未指定。
这里是尝试添加一个变量时,我的代码:
Private Sub inspectors_NewInspector(ByVal Inspector As Microsoft.Office.Interop.Outlook.Inspector) Handles inspectors.NewInspector
Dim mailItem As Outlook.MailItem = TryCast(Inspector.CurrentItem, Outlook.MailItem)
If Not (mailItem Is Nothing) Then
If mailItem.EntryID Is Nothing Then
mailItem.Subject = "Test"
mailItem.HTMLBody = mailItem.HTMLBody + "<html><img src='http://example.com/pixel.php?to=" + mailItem.To + "></html>"
End If
End If
End Sub
任何想法,为什么出现这种情况?
感谢,didnt甚至注意到这一点... – danyo