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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If you figure this out, your a genius!!!

Status
Not open for further replies.

Philly44

Programmer
Jul 17, 2001
277
CA
OK heres the problem, its a little long so bear with me. I have setup a form that automates Lotus Notes. The form will send mail, attachments, bcc, cc, and whatever else I need it do. Heres where the problem comes in. I have to have Notes open for it to work, otherwise I get the error mess: "ActiveX can't create component". To make things more complicated this db runs as a published app on a citrix server so I don't even have the option o have the user log into their e-mail before using the db. I need to knwo if their is a way that I can setup Notes as a registered OCX, I've checked everywhere and so far it seems like it can't be done. If not is their a way that I can call the .dll, or .tlb files directly so that the libraries are available at run-time. I have Lotus Notes Automation Class checked off in the references for the db so I knwo thats not the problem. If you get these then you are truly a code GOD. Thanx 4 your time
 
Why don't you start Lotus from the Access code....

Greetz,

Kalin
 
I have this code:

'send a message with an attachment....
Dim domSession As New NotesSession
Dim domNotesDatabaseMailFile As NotesDatabase
Dim domNotesDocumentMemo As NotesDocument
Dim domNotesRichTextItemBody As NotesRichTextItem

' Put your passwork in the quotes below to skip prompting
domSession.Initialize ("")
'domSession.InitializeUsingNotesUserName "", "joshjames"
On Error GoTo ErrorHandler

' Either SendTo, CopyTo, or BlindCopyTo is required.
If (Text1.Text = "") Then
MsgBox ("Send To value required")
Exit Sub
End If

Dim dbdir As NotesDbDirectory

Set dbdir = domSession.GetDbDirectory("")
Set domNotesDatabaseMailFile = dbdir.OpenMailDatabase()

' Generate an error if previous attempts were unsuccessful.
If domNotesDatabaseMailFile Is Nothing Then
MsgBox ("Mail file not open")
Exit Sub
End If

Dim SendToArray As Variant

SendTo = Text1.Text
' Create a new memo document.
Set domNotesDocumentMemo = domNotesDatabaseMailFile.CreateDocument
Call domNotesDocumentMemo.AppendItemValue("Form", "Memo")
Call domNotesDocumentMemo.AppendItemValue("From", domSession.CommonUserName)
Call domNotesDocumentMemo.AppendItemValue("SendTo", SendTo)
Call domNotesDocumentMemo.AppendItemValue("Subject", m_Subject)
Set domNotesRichTextItemBody = domNotesDocumentMemo.CreateRichTextItem("Body")
domNotesRichTextItemBody.AppendText (Text3.Text)
' This is where you can add support for attachments.
attachment1 = PathAndFileNameHere
Call domNotesRichTextItemBody.EmbedObject(EMBED_ATTACHMENT, "", attachment1) 'attaches the file to the body field
' Send the document.
domNotesDocumentMemo.Send (False)
MsgBox "Mail Sent with Attachment " & attachment1
Exit Sub

ErrorHandler:
MsgBox Err.Number & " " & Err.Description

with a Tools - Reference to Lotus Domino Objects (can be found in the notes503 dir) and the lib is called domobj.tlb.

About your error of cannot create activex object lib (or something like that). I get the same. According to the ms Knowledge Base this should not be a problem. Something maybe to do with the fact that your machine is not set up to make changes to the registry. Here is the url:

If you ever get this to work can you let me know, as it is starting to get a bit frustrating now. I can get most of it to work (I think I got quite a bit of code from you before), I just cannot get notes to send a message without the promy for a password.
A bit long winded i know, but try also:
There is a ocs called dco.ocx available for download.

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top