How to copy a rich text field with a graphics?

Hello,

I am looking a way to grab info from a rich text field with a graphics to current document.

the coding I used below only copy text word without graphics:

Call uidoc.fieldsettext(“Genogram”,doc.Genogram)

the “Genogram” is a rich text field contains a graphics.

Thank you so much in advance.

Linda.

Subject: how to copy a rich text field with a graphics?

You need to get the NotesRichTextItem and then use the doc.AppendRTItem method, which is a backend method.

Subject: RE: how to copy a rich text field with a graphics?

Hi Ben,

I’ve tried “the doc.AppendRTItem”, it is only working for two rich text fields on the same document. I used Picklistcollect to select one document and greb the value of the rich text field to the current document.

I also tried the “Call uidoc.document.CopyItem( item, “Genogram” )”, it doesn’t work.

Thanks,

linda

Subject: RE: how to copy a rich text field with a graphics?

I believe your statemeny about AppendRTItem is wrong.

I’ve copied a button from a Rich Text Field in one document to a RichText Field in another document using AppendRTITem. It does NOT have to be the same document.

Set TheButton = ButtonDoc.GetFirstItem ( “Button” )

Call EmailBody.AppendRTItem(TheButton)

I have a document with a button in it, and then it copied that button into the new e-mail I’m creating. I actually do a Search to find the document.

Is it possible you’re running into this problem where the graphic is in multiple parts like one of my buttons? Follow this link ==>

Subject: RE: how to copy a rich text field with a graphics?

Hi Stephen,

I’ve tried using the coding below, nothing pull forward onto the current documen. if possible, would you please me what’s wrong with my coding?

Dim session As New NotesSession

Dim ws As New NotesUIWorkspace

Dim db As NotesDatabase

Dim  doc As NotesDocument     

Dim uidoc As NotesUIDocument  



    Dim gen As NotesRichTextItem

Dim gen1 As NotesRichTextItem



Set db = session.currentdatabase

Set uidoc=ws.CurrentDocument



Dim collection As NotesDocumentCollection



Set db = session.CurrentDatabase

Set collection = ws.PickListCollection( PICKLIST_CUSTOM, False,"Dom_Svr_1", "Apps\Ver1_LAC.nsf", "(ChildHistoryLookUp)","My Dialog", "Please select a document." )

Set doc = collection.GetFirstDocument

		

Set gen = New NotesRichTextItem (uidoc.document, "Genogram")

Set gen1 =doc.GetFirstItem( "Genogram" )



Call gen.AppendRTItem(gen1)	

   uidoc.document.CSPBy= doc.CSPBy(0)

     ....

Many thanks for your help.

Linda

Subject: RE: how to copy a rich text field with a graphics?

Linda,

Are you seeing anything in the document properties? Multiple $File fields, or your richtext field. I’m curious if the we are actaully getting the data and it’s not displaying or if we’re not getting the data in the first place.

I like others would suggest the following (in red) and the option items (in blue) to see what you get:

(I feel we may also be running into a problem working with backend and front-end classes here. Things maybe right on the backend and then the front end destroys the work we’re done.)

Dim session As New NotesSession

Dim ws As New NotesUIWorkspace

Dim db As NotesDatabase

Dim  doc As NotesDocument     

Dim uidoc As NotesUIDocument  



 Dim gen As NotesRichTextItem

Dim gen1 As NotesRichTextItem



Set db = session.currentdatabase

Set uidoc=ws.CurrentDocument



Dim collection As NotesDocumentCollection



Set db = session.CurrentDatabase

Set collection = ws.PickListCollection( PICKLIST_CUSTOM, False,"Dom_Svr_1", "Apps\Ver1_LAC.nsf", "(ChildHistoryLookUp)","My Dialog", "Please select a document." )

Set doc = collection.GetFirstDocument

		

Set gen = New NotesRichTextItem (uidoc.document, "Genogram")

Set gen1 =doc.GetFirstItem( "Genogram" )



Call uiDoc.Document.AppendText("vvvv ---- Before ---- vvvv")

Call uiDoc.Document.AddNewline(2)

Call uidoc.Save

Call gen.AppendRTItem(gen1)	

Call uidoc.Save

Call uiDoc.Document.AddNewline(2)

Call uiDoc.Document.AppendText("^^^^ ---- After ---- ^^^^")

Call uidoc.Save

uidoc.document.CSPBy= doc.CSPBy(0)

Subject: RE: how to copy a rich text field with a graphics?

Hi Stephen,

I’ve tried your coding. Nothing saved. I checked the document property, there is nothing.

I have no idea why it doesn’t working.

Thanks a lot.

Linda

Subject: Do you have a saveoptions field on the form?

Subject: Are you expecting to see the graphic without saving the doc and then reopening it in the client?

If you save the doc, close it and reopen it do you see the graphic?

Subject: RE: Are you expecting to see the graphic without saving the doc and then reopening it in the client?

Hi Carl,

Nothing happened. even I daved the doc, reopening it.

Thanks,

Linda