Hello;I am creating a document(uicon) using another document(currentdoc). I take some fields from currentdoc and set them in uicon using an agent.I have a field named DM_PieceJointeSolution which is of type ‘Richtext’,i have to take whatever is there and put it in the CNS_PieceJointeSolution field.
Earlier i used to do it like >>>See snippet of codes.
Set currentdoc=uidoc.document
Set uicon = ws.ComposeDocument(nomserverconn,nombaseconn,"CNS",,,True)
Set docconn=uicon.Document
docconn.SaveOptions="1"
Call uicon.FieldSetText("Doc_EDP", ensemble)
Call uicon.FieldSetText("Classeur",classeur)
Call uidoc.GoToField( "DM_PieceJointeSolution" )
Call uidoc.SelectAll
Call uidoc.Copy
Call uicon.GoToField( "CNS_PieceJointeSolution" )
Call uicon.Paste
Call uicon.Refresh
Call uicon.Save
But then the user complained that if he make a ‘print screen’ or copy something before using the agent, whatever he has copied get pasted in the “CNS_PieceJointeSolution” instead of what is in the “DM_PieceJointeSolution”!!!
So I thought of changing the code to this:
Dim rtitemA As Variant
Dim rtitemB As Variant
Set rtitemA = currentdoc.GetFirstItem( “DM_PieceJointeSolution” )
Set rtitemB = docconn.GetFirstItem( “CNS_PieceJointeSolution” )
If ( rtitemA.Type = RICHTEXT And rtitemB.Type = RICHTEXT ) Then
Call rtitemB.AppendRTItem( rtitemA )
end if
Now its not doing anything!!!Whether it has smething in “DM_PieceJointeSolution” or not,it just doesnt do anything.
Can please someone tell me how to do this???
Thanks.