有谁调用过Domino Com组件去发邮件吗
有谁调用过Domino Com组件去发邮件吗,在发送的时候,是否需要打开Notes?那位有过经验,请教一下 --------------------编程问答-------------------- 如果是在客户端那么肯定要打开Notes啦,但是显示不显示出来是另外一回事.但用服务器端就不一样啦 --------------------编程问答-------------------- Sub SendWithLotus()Dim noSession As Object
Dim noDatabase As Object
Dim noDocument As Object
Dim noAttachment As Object
Dim vaFiles As Variant
Dim i As Long
Const EMBED_ATTACHMENT = 1454
Const stSubject As String = "文件發送測試"
Const stMsg As String = "This File Is For You! Just For Reference" & _
vbCrLf & "I am PC-6"
Dim vaRecipient As Variant
vaRecipient = VBA.Array("rockylee@3126.com")
vaFiles = Application.GetOpenFilename(FileFilter:="Excel Filer (*.xls),*.xls", _
Title:="Attach files for outgoing E_Mail", MultiSelect:=True)
If Not IsArray(vaFiles) Then Exit Sub
'Insert Lotus Notes COM object.
Set noSession = CreateObject("Notes.NotesSession")
Set noDatabase = noSession.GetDataBase("", "")
If noDatabase.IsOpen = False Then noDatabase.OPENMAIL
Set noDocument = noDatabase.CreateDocument
Set noAttachment = noDocument.CreateRichTextItem("Body")
'Set noAttachment = noDocument.CreateRichTextItem("Body1")
With noAttachment
For i = 1 To UBound(vaFiles)
.EmbedObject EMBED_ATTACHMENT, "", vaFiles(i)
Next i
End With
With noDocument
.Form = "Memo"
.SendTo = vaRecipient
.Subject = stSubject
.Body = stMsg
.SaveMessageOnSend = True
.PostedDate = Now() - 100
.Send 0, vaRecipient
End With
Set noDocument = Nothing
Set noDatabase = Nothing
Set noSession = Nothing
AppActivate "Microsoft Excel"
MsgBox "This file is send OK", vbInformation
End Sub --------------------编程问答-------------------- 楼上的是实现了什么功能呢,怎么不加点说明啊!
补充:企业软件 , Lotus