Ask the Expert

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.

This was first published in April 2005

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: