In uidoc, I have a field called Lnk1 which is a richtextfield. I created button to create a prdoc and create a document link to this pr doc on the uidoc in the field Lnk1. When I click on this button, there is no document link to prdoc exist in the uidoc. It seems like it is unable to recognize the rich text field. Can anyone help?
Sub Click(Source As Button) Dim workspace As New NotesUIWorkspace Dim uidoc As NotesUIDocument Dim session As New NotesSession Dim unid As String Set uidoc = workspace.CurrentDocument Set doc = uidoc.Document Dim db As NotesDatabase Dim view As NotesView Dim PrDoc As NotesDocument Dim rtitem As NotesRichTextItem Dim lnkDoc As NotesDocument Set db = session.CurrentDatabase Set PrDoc = New NotesDocument( db ) PrDoc.Form = "PO Instruction Entry" PrDoc.Acct_PrYear = Doc.Acct_Year(0) PrDoc.Acct_PrType = Doc.Acct_Type(0) PrDoc.Acct_PrInstrNo = Doc.P1(0) PrDoc.Acct_PrInstDt = Format(Today,"DD/MM/YYYY") PrDoc.Acct_PrIssuedBy = workspace.Prompt( PROMPT_OKCANCELEDIT, "Input", "Please Input Issuer Initial", "") PrDoc.Acct_PrBdgCode = Doc.Acct_BdgCode(0) PrDoc.Acct_PrBdgName = Doc.Acct_BdgName(0) PrDoc.Acct_PrCo = Doc.Acct_Co(0) PrDoc.Acct_PrDeptCd = Doc.Acct_DeptCd(0) PrDoc.Acct_PrDeptName = Doc.Acct_DeptName(0) Call Prdoc.save(True,True) unid = Prdoc.NoteID Set lnkdoc = db.GetDocumentByID( unid ) Set rtitem = New NotesRichTextItem( doc, "Lnk1" ) Call doc.save(True,False) Set rtitem = doc.GetFirstItem("Lnk1") If ( rtitem.Type = RICHTEXT ) Then Call rtitem.AppendDocLink(lnkdoc,"") End If doc.SaveOptions = "1" doc.SaveFlag = "1" Call workspace.ViewRefresh Call doc.save(True,True) End Sub Thank you. Regards.
|