I have a database of docs that have PDFs attached. When I look at the docs via the forms, I see the PDFs in a field defined as Rich Text. They were placed there manually by the users.
I now have to accomplish the same thing programmatically. I create the document and set other Items to text values, but when I attach the PDFs using the AppendItemValue method of the Document object, they are displayed at the bottom of the form. How do I get the attachments into the Rich Text field like my users expect?
Here’s code:
Set objNotesDocument = objNotesDB.CreateDocument
objNotesDocument.AppendItemValue “Form”, “Contract Index”
objNotesDocument.AppendItemValue "Author", "Information Systems"
objNotesDocument.AppendItemValue "Contract_Code", strContractCode
objNotesDocument.AppendItemValue "Contract_Company_Code", strCompanyCode
objNotesDocument.AppendItemValue "Contract_Year", strYear
Set objNotesRTItem = objNotesDocument.CreateRichTextItem(“XYZ.pdf”)
Set objNotesEmbeddedObject = objNotesRTItem.EmbedObject(EMBED_ATTACHMENT, “”, objPDF_File)
objNotesDocument.AppendItemValue "Contract_Image", objNotesRTItem
Markb