Create doclink withouth saving document

I have a button that searches then creates a new doc with search results. A doclink is included with the results. The link only shows though if the document is saved.

I don’t want to save search results so right now I have a script that deletes them. I know that’s not efficient.

How do I make the doclink show without saving?

Dim rtitem As NotesRichTextItem

Set rtitem = New NotesRichTextItem(doc2, “Link”)

'then the save

Call doc2.save( True, True )

Set uidoc = ws.EditDocument(False, doc2)

Subject: RE: create doclink withouth saving document

If I understand you correctly, you are trying to link to an unsaved document. That’s not possible, as doc-links work based on the UNID of the document being linked to, and that’s not assined until the document is first saved.

Subject: RE: create doclink withouth saving document

Correct.

The user searched the db for a pard id. The new search doc opens with the info. If the user chooses to click on the doclinks in the search result doc, the actual document opens. The search will possibly list several documents. When the user closes the search results, the document should not save.

Subject: RE: create doclink withouth saving document

correction…

The new document created from the search has document links to saved documenst. The new search result document just needs to show the links.

I can’t get the links to show unless the search result document is saved.

Subject: RE: create doclink withouth saving document

Update will do, instead of Save.

Subject: create doclink withouth saving document

Create the link with a NOTES:// URL instead of a doc link. This can go into a standard text field… of course its ugly.

notes://database/view/documentid

To see some valid examples, make sure you can see your address bar in the notes client and then from a view, select the address drop down then release it. In my client the currently selected document’s Notes URL appears in the address box.

Subject: create doclink withouth saving document

Hi!

You may use the NotesNewsletter object.

an example:

Dim ws As New NotesUIWorkspace

Dim session As New NotesSession

Dim db As NotesDatabase

Dim collection As NotesDocumentCollection

Dim newsletter As NotesNewsletter

Dim doc As NotesDocument

Set db = session.CurrentDatabase

Set collection = db.UnprocessedDocuments

If ( collection.Count > 0 ) Then

	Set newsletter = New NotesNewsletter( collection )

	Set doc = newsletter.FormatMsgWithDoclinks( db )

	doc.Form = "Memo"

	doc.Subject = "The Arachnid Report"

	Call ws.EditDocument(False,doc)

That works - i haven’t tried to change the rich-text-format…

LG Michael