• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Lotus Notes w/HTML Signature - Please Help!

Maria Clara

New Member
Hello All, I'm utilizing the code below to send e-mail in Notes via VBA but when the user's signature is on html format I get the error below instead of the person's signature? Can anyone shed any light on that? Thank you!


C:notesdatafooter2.htm


""

Sub SendEmail()


Application.ScreenUpdating = False


Dim UserName As String

Dim MailDbName As String

Dim Recipient As Variant

Dim Maildb As Object

Dim MailDoc As Object

Dim AttachME As Object

Dim Session As Object

Dim stSignature As String

Dim Attachment As String

Dim EmbedObj As Object 'The embedded object (Attachment)


With Application

.ScreenUpdating = False

.DisplayAlerts = False

' Open and locate current LOTUS NOTES User

Set Session = CreateObject("Notes.NotesSession")

UserName = Session.UserName

MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"

Set Maildb = Session.GETDATABASE("", MailDbName)

If Maildb.IsOpen = True Then

Else

Maildb.OPENMAIL

End If

' Create New Mail and Address Title Handlers

Set MailDoc = Maildb.CREATEDOCUMENT

MailDoc.Form = "Memo"

stSignature = Maildb.GETPROFILEDOCUMENT("CalendarProfile").GETITEMVALUE("Signature")(0)


' Select range of e-mail addresses

MailDoc.sendto = "e-mail"

MailDoc.Subject = "TEST"

MailDoc.Body = "TEST." & vbCrLf & vbCrLf & stSignature

MailDoc.SAVEMESSAGEONSEND = True


Set AttachME = MailDoc.CREATERICHTEXTITEM("location")

Set EmbedObj = AttachME.EMBEDOBJECT(1454, "Attachment", "location")


MailDoc.PostedDate = Now()

'On Error GoTo errorhandler1

MailDoc.SEND 0, Recipient

Set Maildb = Nothing

Set MailDoc = Nothing

Set Session = Nothing

.ScreenUpdating = True

.DisplayAlerts = True


'errorhandler1:

'

'Set Maildb = Nothing

'Set MailDoc = Nothing

'Set Session = Nothing

'End If

'Next x

End With


End Sub

""
 
Hi, Maria Clara!


Since the issue is regarding Lotus Notes unless someone who knows it (besides Excel) steps in here, I think it won't be easy to help you, as the problem seems to be located in the line:

-----

Code:
stSignature = Maildb.GETPROFILEDOCUMENT("CalendarProfile").GETITEMVALUE("Signature")(0)

-----

which refers to the methods GETPROFILEDOCUMENT and GETITEMVALUE of the object Maildb which is the session database for Notes.


Tried posting this question on a Notes forum?


Regards!
 
Hi Maria,


I would also like to say, to post the question on some Lotus forum..


But before that.. just take a look here.. :)

http://chandoo.org/forums/topic/outlook-to-lotusnotes#post-104083


Regards,

Deb
 
Back
Top