[计算机软件及应用]用VBA操纵Lotus notes发邮件.docVIP

  • 13
  • 0
  • 约2.66万字
  • 约 68页
  • 2018-03-04 发布于浙江
  • 举报

[计算机软件及应用]用VBA操纵Lotus notes发邮件.doc

[计算机软件及应用]用VBA操纵Lotus notes发邮件

287 , 用lotus notes发送邮件, 第一种方法, Sub SendWithLotus() Dim noSession As Object, noDatabase As Object Dim noDocument As Object, noAttachment As Object Dim FileSelf As String Dim i As Long Const EMBED_ATTACHMENT = 1454 Const stSubject As String = For Lotus VBA Programming Test only Dim stMsg As String FileSelf = ThisWorkbook.Path + \ + ThisWorkbook.Name stMsg = Bst Rgds vbCrLf _ Application.UserName vbCrLf _ vbCrLf _ ************************************************************************** vbCrLf _ (Thiss an automated e-mail notification, please do not reply this message.) Dim vaRecipient As Variant vaRecipient = VBA.Array(huangfeng8211@163.com) Insert Lotus Notes COM object. Set noSession = CreateObject(Notes.NotesSession) Set noDatabase = noSession.GETDATABASE(, D:\notes\data\mail3\tonyhf.nsf) If noDatabase.IsOpen = False Then noDatabase.OPENMAIL Set noDocument = noDatabase.CREATEDOCUMENT Set noAttachment = noDocument.CREATERICHTEXTITEM(Body) noAttachment.EMBEDOBJECT EMBED_ATTACHMENT, , FileSelf With noDocument .Form = Memo .SendTo = vaRecipient .Subject = stSubject .Body = stMsg .SAVEMESSAGEONSEND = True .PostedDate = Now() .SEND 0, vaRecipient End With Set noDocument = Nothing Set noDatabase = Nothing Set noSession = Nothing AppActivate Microsoft Excel MsgBox This file be sent, vbInformation End Sub 第二种方法 Sub SendWithLotus() Dim noSession As Object, noDatabase As Object Dim noDocument As Object, noAttachment As Object Dim vaFiles As Variant Dim i As Long Const EMBED_ATTACHMENT = 1454 Const stSubject As String = For Lotus VBA Programming Test only Const stMsg As String = This file is for you! just for reference vbCrLf I am StanleyPan Dim vaRecipient As Variant vaRecipient = VBA.Array(stanleypan2000@, stanley.pan@IsolaA) vaFiles = Application.GetOpenFilename(FileFilter:=E

文档评论(0)

1亿VIP精品文档

相关文档