Manage Learn to apply best practices and optimize your operations.

Rich Text Template

Using an editable Rich Text template wihout the need for a permanent document
template (Notes 4.5 and higher)
Sub Click(Source As Button)
Dim ws As New notesuiworkspace
Dim session As New notessession
Dim db As notesdatabase
Dim doc As notesdocument, template As notesdocument
Dim rtitem As notesrichtextitem

Set db =session.currentdatabase
'Initiate a document that will temporarely serve as the template
Set template = db.createdocument
'The following Form is in fact the Rich Text template (with fonts, tables,
work arts, etc.)
template.Form = "PODTemplate"

'Create the document that will be initialized with the template
Set doc = db.createdocument
'Note that the following Form contains a editable Rich Text field named
"Body"
doc.Form = "POD2"
Set rtitem = doc.createrichtextitem("Body")

'That is where it happens: The template is pictured within the new Rich
Text field
Call template.rendertortitem(rtitem)
'The new document must be saved (well, that is the price to pay...)
Call doc.save(True,False)

'Editing the document gives the effect of composing a new document with a
great and editable Rich Text template.
Call ws.editdocument(True, doc)

'Good Luck in your projetcs!
End Sub

Dig Deeper on Domino Resources - Part 6

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

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