Edit a doc from a notesdocumentcollection

I have a main document (opened in the UI), with a button on it. The button puts all the document’s response docs into a NotesDocumentCollection using "Set dc = thisdoc.Responses"I want to check if we have a response doc based on a particular form, and: if it exists, open it in the UI, and if it doesn’t exist, create it and let the user fill in stuff.

So far I can cycle through the (6) response docs and get a handle on the correct (background) one using this code:

Set doc = dc.GetFirstDocument

While Not (doc Is Nothing)

If doc.form(0) = “CheckMTNewProduct” Then

MsgBox(“Found it!”)

So my question is: how can i open this doc for my users to edit?

I’ve done this:

unid = doc.UniversalID

but now sure what to to with it…:slight_smile:

Any suggestions / code snippets?

Subject: edit a doc from a notesdocumentcollection

The EditDocument method of the notesuiworkspace class will provide you with what you are looking for.

The help has examples of what you need to do.

HTH

Subject: (updated) edit a doc from a notesdocumentcollection

But, I don’t know how to assign the doc (background) to the uidoc (foreground) so that I can use the NotesUIWorkspace methods…if I use

unid = doc.UniversalID

ws.EditDocument(unid) then I get a Type Mismatch error msg.

Subject: RE: (updated) edit a doc from a notesdocumentcollection

Call ws.EditDocument(True, doc)

Try reading the documentation sometimes. None of the arguments to this method is a UNID.