Selecting a document and getting it to open in a browser

Can you help a beginning developer? I have a view in the Notes client. When I select a document it opens in another tab. When you select a document to open it, is there a way so that it opens in a browser?

Yes, assuming the application is available on a Domino server with HTTP task-enabled. However, I have to wonder why, when you have the Notes client available, you would want to use a Web browser to open the document. You might want to think about ways to do in the Notes client whatever it is you're using the browser for now.

Anyway, to open a browser window in lieu of the Notes document, you need to code in an event that will notice the user trying to open the document, and do something else instead. This code may either be in the Queryopen event of the form (if you want it to do this from every view) or in the Queryopendocument event of the view (if you only want to have it happen in a particular view). In either case, you would use the statement Continue = False, which is the signal to Notes to not go ahead with opening the document, and then use NotesUIWorkspace.URLOpen method to open the browser window and display the document in it.

Of course you will need to compute the URL of the Notes document. In the simplest case you can use the NotesDocument.HttpURL property for this, but if you're trying to do it from a replica other than the one on the Domino server you are "browsing" on, you'll have to compute the URL using an expression such as "http://server/yourdb.nsf/0" & doc.UniversalID & "?OpenDocument."

Do you have comments on this Ask the Expert question and response? Let us know.

Dig Deeper on Web Development for Lotus Notes Domino

  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...