Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lotus Notes on Citrix through VBA

Status
Not open for further replies.

robeau

MIS
Oct 20, 2000
30
CA
Hi,

I am running a VBA macro on a Citrix server connection. The VBA macro is supposed to send out emails. I can successful create the Notes Session (it prompts for the password, etc...), but I get a Dr Watson error when it starts to create the email message (Document.AppendItemValue command).

If I run the same piece of code from the local workstation, it runs successfully and sends the email. The differences are the Citrix connection has NotesVersion 5.0.9 (November 2001), and the local runs NotesVersion 5.0.5 (September 2000).

Are there any issues with trying to send emails through Notes on a Citrix connection?

I'm not a Notes expert, so I'm not sure where to go next to diagnose this problem. Any help is greatly appreciated.

Here is the code:

Sub SendNotesEmail(Subject As String, _
ByVal Attachment As String, _
Recipient As String, _
BodyText As String, _
SaveIt As Boolean)
Dim AttachME As Object 'The attachment richtextfile object
Dim EmbedObj As Object 'The embedded object (Attachment)
Dim MailDb As NotesDatabase 'The mail database
Dim MailDbName As String 'The current users notes mail database name
Dim MailDoc As NotesDocument 'The mail document itself
Dim MailFile As String 'The mail ename
Dim Session As notessession 'The notes session
Dim MailList() As String 'Multiple recipients

Set Session = New notessession
Session.Initialize
Set MailDb = Session.GetDbDirectory("").OpenMailDatabase

If MailDb.IsOpen = False Then
MailDb.Open
End If

Set MailDoc = MailDb.CreateDocument

MailDoc.AppendItemValue "Form", "Memo" '(**this is where I get the error**)
MailDoc.AppendItemValue "Subject", Subject
MailDoc.AppendItemValue "Body", BodyText
MailDoc.AppendItemValue "PostedDate", Now()
MailDoc.AppendItemValue "SendTo", "myemail@hotmail.com"
MailDoc.SaveMessageOnSend = SaveIt

Set AttachME = MailDoc.CreateRichTextItem("Attachment")
'Set EmbedObj = AttachME.EmbedObject(1454, "", Attachment, "Attachment")

MailDoc.Send True

Set EmbedObj = Nothing
Set AttachME = Nothing
Set MailDoc = Nothing
Set MailDb = Nothing
Set Session = Nothing
End Sub

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top