Attaching a file in the richtext field

Hi all ,

i do have a document with a file attached in its rich text field say its a PDF file. I need to import it in the document, i am newly creating. (i.e) in the form… i have used a button to import the rich text field in the other document. In the begining it was showing default form cannot be located… then i made a form as a default form… thereafter in which ever form within the database, if i try to import the data(PDF File) it gets stored in the default form and not in the form in the UI.

Set dc = ws.PickListCollection(PICKLIST_CUSTOM,False,sname,Adbname,“(vwTemplateList)”,“BManager”,“Select a Product…”)

If dc.Count=0 Then Exit Sub

Set doc1 = dc.GetFirstDocument

Set rtitemA = doc1.GetFirstItem(“rtBody”)

Call rtitemB.AppendRTItem(rtitemA)

Call udoc.Save(True,False)

Call uidoc.Close

Call ws.EditDocument(True,udoc)

rtitemB points to the current documents richtext field

Udoc is uidoc.Document

how to sort out this??

Thanks in advance.

Subject: RE: Attaching a file in the richtext field

I think your problem is that you are not assigning the “Form” field of the document udoc before you open it.

It doesn’t look like you are showing us your actual code – please copy/paste, do not retype your code. One character can make a big difference. In this case you are sometimes using udoc and sometimes doc1, for (I think) the same document.