Skip to main content
Information Mgmt
New to Lotus
How to buy
Live demos
Technical library
Forums & community
Java™ technology
Open source
SOA and Web services
Web development
My developerWorks
About dW
Submit content

developerWorks  >  Lotus  >  Forums & community  >  IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

Sign in to participate Previous Next
Subject: LotusScript COM: Open NotesDocument in UI
Feedback Type: Question
Product Area: Database
Technical Area: Application Development
Platform: Windows
Release: 8.5
Reproducible: Always

I am working on coexistence between Microsoft Outlook and IBM Lotus Notes.

Outlook Items = Notes Documents

I am adding context menu's in Outlook where a user clicks any Item in MS Outlook would display a "Open Document" option. I have everything working to the point where I need to display the document in Lotus Notes.

I can open Notes databases through COM, got to a view and highlight a document. But I cannot figure out a way to open the document through COM.

The code below shows how I'm doing this and it errors out at NotesUIWorkspace.EditDocument(LNdoc) line.

I tried returning to a NotesUIDocument, that errors out, I tried all combinations of input parameters to EditDocument(boolvalue, doc, boolvalue).

Is there an alternative solution to open a document through com?

Public Sub OpenLNDatabase(servername As String, dbname As String, docID As String, docKey As String)

Dim ws As Object '(NotesUIWorkSpace)
Dim cLotusNotes As New clsLotusNotes
Dim LNDb As NotesDatabase
Dim LNdoc as NotesDocument
Dim LNSession as new NotesSession

If (servername = "" Or dbname = "") Then
MsgBox "I am not configured to open this Lotus Notes database. Please contact support", vbCritical, Title
Exit Sub
End If

Set LNSession = New NotesSession
Call cLotusNotes.session.Initialize

Set ws = CreateObject("Notes.NotesUIWorkspace")

Set LNDb = LNSession.GetDatabase(servername, dbname)

If (docID = "" And docKey = "") Then
Call ws.OpenDatabase(servername, dbname, "", "", "")
'open document in database by docuid
If (docID <> "") Then
Set LNDoc = LNDb.GetDocumentByUNID(docID) 'works
Call ws.EDITDOCUMENT(LNDoc) 'automation error

If (docKey <> "") Then
'search a view for a field value
'to get a handle to a notesdocument.
End If
End If

End If

Set ws = Nothing

End Sub

Feedback number WEBB89ZM6B created by Steve Lohja on 10/07/2010

Status: Open

LotusScript COM: Open NotesDocument... (Steve Lohja 7.Oct.10)
. . Use NotesURL (Simon Delicata 11.Oct.10)


Search this forum

Sign In or Register

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

Member Tools

RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds


Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds


IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite