Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfert text between rich text fields

Status
Not open for further replies.

saecsens

Programmer
Aug 5, 2003
21
0
0
CA
I have 2 rich text fields. When an action is performed, the text from on RTF will be copied unto the other RTF. I'm able to perform that using 2 text fields, but I'm still unable to do the same using the RTF. Can someone help me with that ???


thanx
 
Hi,

You can not just copy text between RT fields.
RT fields have a lot of limitations compared to text fields.

However you can use the @Abstract ([TextOnly])formula for example to extract text from a RT Field and work with that.

The best way to go here is actually using Lotus Script where it is more easy to manipulate and format the text.

In all cases it takes a lot of work and testing to make it work, and not everything is possible.

If you need the entire field contents to be the same (an exact copy of the RT Field) then use Lotus Script to copy the entire Rich Text item.



Kind regards,

Dominik Malfait
dominik@amazingit.com
 
thx you very much for your help.

I'm not familliar at all with the use of LS. Can you help me with an exemple of code that would transfer all the content of a RTF to my other RTF ?
 
What you can do is create a new Rich Text item or select an existing one and then append the contents of the first item to the second item using the AppendRTItem method.

Below is an example from the Designer help:

Dim docA As NotesDocument
Dim docB As NotesDocument
Dim rtitemA As Variant
Dim rtitemB As Variant
'...set values of docA and docB...
Set rtitemA = docA.GetFirstItem( "Body" )
Set rtitemB = docB.GetFirstItem( "Body" )
If ( rtitemA.Type = RICHTEXT And _
rtitemB.Type = RICHTEXT ) Then
Call rtitemA.AppendRTItem( rtitemB )
Call rtitemB.Remove
Call docA.Save( False, True )
Call docB.Save( False, True )
End If



Kind regards,

Dominik Malfait
dominik@amazingit.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top