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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

# column with the selected document

Status
Not open for further replies.

cramd

Programmer
Mar 28, 2001
214
US
I have a view that includes 4 documents: spring, summer, fall, and winter. I select the summer document to use for an email that I'm testing. In code, I'm not clear as to how I pull the field information from the summer document that I've selected. The column is #, there is a check mark next to summer.....but in my code, I can't do this:

Set view=db.getview("messageVW")
Set doc=view.getfirstdocument......since summer is not first document, I'm looking for something like SET DOC = view.getselecteddocument....but that does not work.

In code, how do I reference the selected document?

cramd
 
I'm not an expert in LotusScript but I think you would use the GetDocumentByKey method. Something like this.

key = "Summer"
Set db = session.CurrentDatabase
Set view = db.GetView ("View Name" )
Set doc = view.GetDocumentByKey (key )

I think you could also use NotesDocumentCollection and UnprocessedDocuments. This will get all the selected document(s) in the view.

Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
Set doc = collection.GetFirstDocument()

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top