Hello, all.
I have a problem. In a databes A i create a Action Hotspot that list a view from another database B and populate a field and insert a doclink from database B document to a RichText field into database A.
But an error occur when i try append the doclink.
Can someone else help me?
Follow the code:
Sub Click(Source As Button)
Dim uiwork As New notesuiworkspace
Dim uidoc As notesuidocument
Dim session As New notessession
Dim db As notesdatabase
Dim doc As notesdocument
Dim currdoc As NotesDocument
Dim sel_doc_collection As notesdocument
Dim ask As Variant
Dim collection As NotesDocumentCollection
Dim rtf1 As NotesRichTextItem
Dim item,item1 As NotesItem
Set uidoc = uiwork.currentdocument
Set doc=uidoc.document
Set db = session.CurrentDatabase
Set currdoc = uiwork.CurrentDocument.Document
Set collection = uiwork.PickListCollection(1, False, “Server”, “databaseB.nsf”, “View”,“Project List”, “Please select a Project”)
If collection.count = 0 Then
Messagebox “User cancelled”,“No document selected”
Else
Set sel_doc_collection = collection.GetNthDocument(1)
Set rtf1 = currdoc.GetFirstItem(“DVPLink”)
'Here the field rtf1 is empty (may be because is a new document???)
Call rtf1.AppendDocLink(sel_doc_collection,“DVPLink”)
’ Here appears the error “Object variable not set”
Call rtf1.AddNewline(1)
Call uidoc.FieldSetText(“DVPCod”, sel_doc_collection.Codigo(0))
Call uidoc.FieldSetText(“ProjDes”, sel_doc_collection.Descrip(0))
Call uidoc.refresh
End If
End Sub
Tanks
João