Vba 用NOTES发送邮件 不会有XP的安全警告

来源:互联网 发布:js随机数 编辑:程序博客网 时间:2024/06/06 17:59
'在notes 7.0 Excel2003上测试通过'必须先引入对象lotus domino Objects对象 Sub NotesSendMail() Dim session As New NotesSession
 Dim userdbname As String
 Dim doc As NotesDocument
 session.Initialize ("password")
 Dim db As NotesDatabase
' Dim body As NotesRichTextItem
 
 
 Set db = session.GetDatabase("domino server name", "Mail database (*.nsf)", False)
 Set doc = db.CreateDocument
 ret = doc.AppendItemValue("Form", "Memo")
 
 With doc
        .AppendItemValue "Form", "Memo"
        .AppendItemValue "Subject", "Test E Mail"
        .AppendItemValue "SendTo", "mail@123.net"
        Set  body = .CreateRichTextItem("Body")
       
        With body
            .AppendText "This is a Test Mail"
        End With
        .SaveMessageOnSend = True
        .Send False
       
    End With
   
   
    Set  body = Nothing
    Set doc = Nothing
    Set db = Nothing
   Set session = Nothing
    

   
 End Sub
 
原创粉丝点击