Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


Open non-email Lotus Notes Database using VBA

Open non-email Lotus Notes Database using VBA

Open non-email Lotus Notes Database using VBA

I posted the following on another thread on this site last week, and am following a suggestion to try this forum instead... see below:

pscribby (Programmer)      
20 Aug 09 13:22
I am trying to write a VBA module for use inside an MS Access database.  Inside the Access dB, I have a claim number.  I need to set up a button on my form in Access which, when clicked opens the Claims Database, which is a Lotus Notes Database.  I do not need to transfer any data in either direction, I just want to open the Notes database in the client of Lotus Notes, and show the form view for the record (document in Notes terminology) that matches my claim number.  I do not know Notes at all.  I have managed to enable the Notes objects/classes in Visual Basic, but don't know how to correctly use them.  I have the server path, database file name, name of the form inside the Notes dB, and the name of the field on the Notes form (which I need to match to my variable)...
So far, I can only successfully open the Notes database using a shell command.  I have a test code module where I have been able to successfully (I think) declare the needed variables, set session, set db, but db.open gives me a "type mismatch" error.  Below is the code so far (which isn't working...  and I have not added the details to specify the field and search variable yet):

Private Sub test2()

Dim db As Object
Dim dbname As String
Dim dbpath As String
Dim session As Object
Dim view As Object

Set session = CreateObject("Notes.NotesSession")

dbname = "<mydatabase.nsf>"
dbpath = "<myserverpath/>"
Set db = session.GetDatabase(dbpath, dbname)

Set view = db.GetView("<myformname>")


End Sub

HughLerwill (Programmer)     
21 Aug 09 14:52
I cannot be of much help because I do not have Notes to play with (and do not know much about it) but I think a Google for;


may be of help. Most examples are for email from vb code (my main interest) but it seems notesuiworkspace needs to be used to get Notes to display stuff on-screen.

A Google for 'Domino' may give you an object model.

forum9: Lotus/IBM: Domino: Lotus/IBM: Domino may be worth a try.

Thank HughLerwill
for this valuable post!


pscribby (Programmer)     
26 Aug 09 12:49
Thanks HughLerwill!

I have 2 different paths I experimenting with.  One of them includes the notes.notesuiworkspace method that you mentioned.  Below is the code so far:

Private Sub test2()

Dim db As Object
Dim dbname As String
Dim dbpath As String
Dim dbfull As String
Dim session As Object
Dim view As Object
Dim doc As Object
Dim docname As String

docname = "<a known good doc number>"

Set session = CreateObject("Notes.NotesSession")

Set uiworkspace = CreateObject("Notes.Notesuiworkspace")

dbname = "<mydbname>"
dbpath = "<mypathname>"
Set db = session.GetDatabase(dbpath, dbname)

Set view = db.GetView("fm_ClaimCase")

End Sub

This code does not throw any errors on debug, and when I run it, no errors appear - but nothing seems to happen either (ie: the notes ui session does not open).  I have another approach in which I can successfully open the notes ui workspace using a shell command, but where I get stuck there is that I can't figure out how to specify the view/form and the document I want opened on said view/form...  I've Google'd this dozens and dozens of times every which way I can think of... all I keep getting are ways to generate emails from/inside of Notes... nowhere am I finding anything on opening a non-email Notes database...  I will also look in the other forum you mentioned to see if somebody there maybe has an idea...
All ideas are appreciated!  Thanks!  

RE: Open non-email Lotus Notes Database using VBA

Solution Found!

With the help of a response on another thread, and some additional research, I found the solution.  The working code is posted below for anyone who may be looking for a similar solution...


Public Function openLegalClaim(legalclaim As String)

Dim dbname As String
Dim dbpath As String
Dim docname As String
Dim notesuiworkspace As Object

docname = legalclaim

Set notesuiworkspace = CreateObject("Notes.Notesuiworkspace")

dbname = "<dbname>"
dbpath = "<dbserverpath>"

Call notesuiworkspace.OpenDatabase(dbpath, dbname, "<viewname>", docname, False, False)

End Function

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close