开发者

Excel macro send rich mail using LotusNotes

I'm working on a small macro to send mail from excel 2007 using my Lotus Notes session. The sending mail part is working fine. Now I need to send in the body part, a part of a stylesheet (for instance the area from A1:B20). This area has colors, bold font. To send my email here is the code:

Set oSess = CreateObject("Notes.NotesSession")
Set oDB = oSess.GETDATABASE("", "")
Call oDB.OPENMAIL
flag = True
If Not (oDB.IsOpen) Then flag = oDB.Open("", "")


If Not flag Then
    MsgBox "Can't open mail file: " & oDB.SERVER & " " & oDB.FILEPATH


End If
On Error GoTo err_handler

'Building Message
Set oDoc = oDB.CREATEDOCUMENT



Set oItem = oDoc.CREATERICHTEXTITEM("BODY")


oDoc.Form = "Memo"
'mail subject
oDoc.Subject = "subject"
'mail body
oDoc.sendto = "toto@myserver.com"
oDoc.body = "my text"

oDoc.postdate = Date
oDoc.SaveMessageOnSend = True


oDoc.vi开发者_StackOverflow社区sable = True
'Sending Message
oDoc.SEND False

Does anybody has an idea about how to send a stylesheet ?


You can try the solution described in this SO question : Sending formatted Lotus Notes rich text email from Excel VBA

Regards,

Max

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜