How to read document data from Notesuiview without opening a doc?

Hi,

Can someone have a quick look at my code, because I’m not sure what I’m doing wrong.

I don’t want to open a document when it’s clicked on, but I do want to read data from it

(this is for a portal app, where it would read the URL/EXE/DOC etc from the document and launch it, rather than opening the Config Document).

Sub Queryopendocument(Source As Notesuiview, Continue As Variant)

Dim uidoc As NotesUIDocument



Set ws = New NotesUIWorkspace

Set uidoc = ws.CurrentDocument



Dim DocInfo As String



DocInfo = uidoc.FieldGetText ("TXTTitle")

Msgbox DocInfo

End Sub

Thanks…

Subject: How to read document data from Notesuiview without opening a doc? (Solved)

Typical… I managed to solve the problem immediately after posting - my apologies for wasting everyones time.

The trick was to use the NotesDocumentCollection even though I only wanted info about one document.

My resolved example is below - in case anyone else has this problem…


Sub Queryopendocument(Source As Notesuiview, Continue As Variant)

Dim docs As NotesDocumentCollection

Dim doc As NotesDocument



Set docs = Source.Documents

Set doc = docs.GetFirstDocument()



Dim DocInfo As String



DocInfo = doc.TXTTitle(0)

Msgbox DocInfo



Continue = False	

End Sub

Subject: How to read document data from Notesuiview without opening a doc?

use the NotesUIView that is:Sub Queryopendocument(Source As Notesuiview, Continue As Variant)

dim doc as NotesDocument

Set doc = Source.Document

Here doc is the backend document object of

higlighted document in the view.

Now you can access the items in the doc without opening them.