其实就是一个 MAPIMessages1 和MAPISession1的使用问题
简单点,给出代码就是了
Private Sub Value_DataUpdate()
dim retstatus as long
If Value.GetValue(ThisDisplay.EndTime, retstatus) > 90 Then
ThisDisplay.SaveAs "c:\1.jpg", pbpdFormatJPEG
MAPISession1.UserName = "Microsoft Outlook"
MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.Compose
MAPIMessages1.RecipDisplayName = "Nick "
MAPIMessages1.RecipAddress = "xxx@osisoft.com"
MAPIMessages1.AddressLabel = "xxx@osisoft.com"
MAPIMessages1.MsgSubject = "Batch Report"
MAPIMessages1.MsgNoteText = "Here is the procbook.ini as of " & Now
MAPIMessages1.AttachmentPathName = "c:\1.jpg"
MAPIMessages1.Send False
MAPISession1.SignOff
End If
End Sub