Link to home
Start Free TrialLog in
Avatar of jacob_to
jacob_to

asked on

Lotus Notes Automation Classes

dear friends,
how can i give lotus notes user connection password through the automation classes (5.x).

also i am able to read the message body and attachment, but i'm not getting the message subject.

can you please help on these two points.

greetings
jacob
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

This works for my Notes mail database.

It may be that the field name of your document that is labelled Subject is not actually named Subject. To check, right-click on the document in Notes client, choose Document properties and then the tab with the right-angled triangle. This gives a list of fields with contents and other properties.

    Dim Session As New NotesSession
    Dim DB As NotesDatabase
    Dim Vw As NotesView
    Dim ve As NotesViewEntry
    Dim vwc As NotesViewEntryCollection
    Dim e As Integer
    Dim Doc As NotesDocument
    Dim Subject As String
   
    Session.Initialize "password"  '<- put the password in here
    Set DB = Session.GetDatabase("notes server", "path\notes database") '<- put your server and database in here
    Set Vw = DB.GetView("($inbox)")
    Set vwc = Vw.AllEntries
    For e = 0 To vwc.Count
        Set ve = vwc.GetNthEntry(e)
        Set Doc = ve.Document
        Subject = Doc.GetItemValue("Subject")(0)
        Debug.Print Subject
    Next e
Avatar of jacob_to
jacob_to

ASKER

hello grahamskan,
thanks for the reply.

but i dont have Session.Initialize "password" property in my lotus auotmation class (i used lotus 6.0 to create the class)

is there any other way to give the password?

also the i am not able to get the subject even though my subject field is also "Subject". do i have to use NotesViewEntryCollection? is there any simple way?


thanks in advance

ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks grahamskan,
i am able to take the subject text.

trust that there is NO way to give password through automation classes. i am using 'Centura' for development and my development version do not support COM well. any way thanks for your replies.

best regards
jacob
Hi jacob
This link documents an API way of providing a password

http://www.angelfire.com/realm/vb-shared/notespwd.htm
Cheers, Graham