问题描述
急急包,CS模式怎樣在當前打開的表單欄位里插入文檔鏈接,以下代碼怎么無效SubClick(SourceAsButton)DimworkspaceAsNewNotesUIWorkspaceDimsessionAsNewNotesSessionDimdbAsNotesDatabaseDimdcAsNotesDocumentCollectionDimdoc,currdocAsNotesDocumentDimuidocAsNotesUIDocumentDimrtfAsNotesRichTextItemDimitemAsNotesItemDimrAsVariantSetuidoc=workspace.CurrentDocumentSetcurrdoc=uidoc.DocumentIfuidoc.EditModeThenIfcurrdoc.TEA(0)<>""ThenSetdc=workspace.PickListCollection(PICKLIST_CUSTOM,False,"TXJ_DS1/Shenzhen/AIC","AICGroupHR-DB.nsf","IndexByRLJH-2","招聘計劃列表","請選擇計劃項:","2013"+currdoc.TEA(0))ElseSetdc=workspace.PickListCollection(PICKLIST_CUSTOM,False,"TXJ_DS1/Shenzhen/AIC","AICGroupHR-DB.nsf","IndexByRLJH-1","招聘計劃列表"+"["+uidoc.FieldGetText("DEPT")+"]","請選擇計劃項:","2013"+currdoc.DEPT(0))EndIfIfdc.Count>0ThenSetdoc=dc.GetFirstDocumentSetitem=currdoc.ReplaceItemValue("JH",Str(doc.JH(0)))Setitem=currdoc.ReplaceItemValue("ZJ",Str(doc.ZJ(0)))Setitem=currdoc.ReplaceItemValue("PlanDate",Str(Year(doc.planDate(0)))+"-"+Str(Month(doc.planDate(0))))Setitem=currdoc.ReplaceItemValue("Division",doc.SYDep(0))Setitem=currdoc.ReplaceItemValue("Department",doc.Department(0))Setitem=currdoc.ReplaceItemValue("Team",doc.Team(0))r=getPersonByDept(doc.SYDep(0),"","","01-聘用")Setdc=r(1)Setitem=currdoc.ReplaceItemValue("DivCount",Str(dc.Count))r=getPersonByDept(doc.SYDep(0),doc.Department(0),"","01-聘用")Setdc=r(1)Setitem=currdoc.ReplaceItemValue("DepCount",Str(dc.Count))Ifdoc.Team(0)<>""Thenr=getPersonByDept("","",doc.Team(0),"01-聘用")Setdc=r(1)Setitem=currdoc.ReplaceItemValue("TeamCount",Str(dc.Count))EndIfSetitem=currdoc.ReplaceItemValue("SJBH",doc.SJBH(0))Setitem=currdoc.ReplaceItemValue("SJMC",doc.SJMC(0))r=getJobTitle(doc.SJBH(0))Setdc=r(1)Ifdc.Count>0ThenSetdoc=dc.GetFirstDocumentSetrtf=Newnotesrichtextitem(currdoc,"RTF")'Setrtf=currdoc.GetFirstItem("RTF")'Callrtf.RemoveCallrtf.AppendText("aaaaa")Callrtf.AppendDocLink(doc,"Document")EndIfElseEndIfCallworkspace.CurrentDocument.Refresh()EndIfEndSub
解决方案
解决方案二:
必须先将文档保存在后台,再访问RTF域。
解决方案三:
要使得RTF域生效,必须是保存后,再打开才会看到效果
解决方案四:
正解,得先保存后台document