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!

Open LOTUS NOTES database object from within Access

Status
Not open for further replies.

LeanneGodney

Technical User
Mar 7, 2002
175
GB
Hi there,

I'm aware of how to grab a notesitem or notesdocument in vba from access, but I'm unsure as to how to DISPLAY it for the user... If I'm storing the Notes ID in table I can use this to access the document:

Set DomSession = CreateObject("Lotus.NotesSession")
DomSession.Initialize
Set DomDir = DomSession.GetDatabase("0BMT00NA02/CHASE", "apps\cpcolt.nsf")

Set DomDoc = DomDir.GetDocumentByUNID("Hefefekei224450023")

But how do I then instruct Lotus notes to OPEN that document and display it???

Any help would be well appreciated.

Thanks!
 
In order to display the document, you need to declare a WORKSPACE in LotusNotes:

Dim workspace As New NotesUIWorkspace

then try this:

Call workspace.EditDocument( True, DomDoc )



Leslie
 
Hi Leslie,

Thanks for that... Trouble is my code won't allow me to use the NEW work in your dim workspace text... It lets me do dim workspace as notesuiworkspace, but I can't put the word new in!

Any idea why? Is there some other way I can create a new workspace without doing it in teh declaration?

Thanks!
Leanne
 
Here's an example from the OLE help in NotesDesigner:

Set workspace = CreateObject("Notes.NotesUIWorkspace")
Set doc = workspace.CurrentDocument

Leslie
 
Hi Leslie,

Thanks for that - I am able to create the workspace object now (but only if I don't declare it). When I true to use the EditDocument method I get an error of Runtime 7419 - Incorrect Argument type: object expected.

Any ideas? this is my code:

Set DomSession = CreateObject("Lotus.NotesSession")
DomSession.Initialize MyPassword
Set DomDir = DomSession.GetDatabase("0BMT00NA02/CHASE", "apps\cpcolt.nsf")
Set DomContacts = DomDir.GetView("Admin\All By Status")

Set DomDoc = DomDir.GetDocumentByUNID("1E051FF601BE882280256FA1001D329D")
Set Workspace = CreateObject("Notes.NotesUIWorkspace")

Workspace.EDITDOCUMENT False, DomDoc
 
I'm pretty sure you need the parens:

Workspace.EDITDOCUMENT (False, DomDoc)

Is DomDoc declared as a NotesDocument?



Leslie
 
You can't put the parenthesis if you're not using SET, and you have to use parenthesis if you are.

I've tried it with declaring DomDocs as a notesdocument and also without... same result.

I'm doing this in VBA, by the way... does that make a difference?
 
I would suggest searching the Access forums for Lotus Notes and I know there are some examples of access Notes, but I don't recall if they deal specifically with being able to show the document in a workspace.

Forum181
Forum705

HTH

Leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top