Manage Learn to apply best practices and optimize your operations.

Lotusscript Notes Appendrtitem Method - Copy Richtextitem Font Information

When you use AppendRTItem to copy a rich text item, you will lose your font
name attribute
of the item.
Here is a workaround for this particular case. Before calling the AppendRTItem
method, you
must copy the $fonts item from the source document to the destination document.
Sub Click(Source As Button)
Dim s As New NotesSession
Dim ws As New NotesUIWorkspace
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim currentdoc As NotesDocument
Dim Newdoc As NotesDocument
Dim item As Variant
Dim RTItem As NotesRichTextItem
Set db = s.CurrentDatabase
Set uidoc = ws.CurrentDocument
Set Newdoc = New NotesDocument(db)
Set currentdoc = uidoc.Document
Set Item = currentdoc.GetFirstItem ( "Form" )
Newdoc.form = Item.Text
Newdoc.subject = uidoc.FieldGetText ( "Subject" )
Set item = currentdoc.GetFirstItem ( "Body" )
Set RTItem = Newdoc.CreateRichTextItem ( "Body" )
%REM
'Here we copy the font information located in the $fonts item
%END REM
Set font = currentdoc.GetFirstItem ( "$Fonts" )
Call font.CopyItemToDocument ( Newdoc , "" )
Call RTItem.AddNewLine ( 1 )
Call RTItem.AppendRTItem ( item )
Call Newdoc.save ( True , True )
End Sub

Dig Deeper on Domino Resources - Part 4

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close