Manage Learn to apply best practices and optimize your operations.

Adding Formated Table To The Document

You have a situation where users should fill in the table in certain format in
the notes document. Here's the script what pastes a formated table to the
field. Then saves the document and opens it again.
First you have to create a template document where is the table in right
format you want to be used. Then write down the ID of the template document
and use it in your script.
Sub Click(Source As Button)
Dim DB As NotesDatabase
Dim HDoc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim HelpBody As NotesItem
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim doc As NotesDocument
Dim uidoc As NotesUIDocument
Dim Body As Notesitem

'-- Setting values
Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.document

If uidoc.IsNewDoc Then
doc.form = "FormName"
Set rtitem = doc.CreateRichTextItem( "Bodytext" )
Call doc.save(True, True)
Else
Set rtitem = doc.GetFirstItem( "Bodytext" )
Call doc.save(True, True)
End If

ID = doc.NoteID
Set DB = session.CurrentDatabase
Set HDoc = DB.GetDocumentByID( "000036D6")
Set Body = HDoc.GetFirstItem( "Table" )
Call rtItem.AppendRTItem (Body)
Call doc.save(True, True)

'Close document and open again
Set uidoc = workspace.CurrentDocument
Call uidoc.fieldsettext("SaveOptions", "0")
Call UIDoc.close
Set Doc = DB.GetDocumentByID(ID)
Set uidoc = workspace.EditDocument(True, doc, False)
Call uidoc.fieldsettext("SaveOptions", "1")
End Sub

Dig Deeper on Domino Resources - Part 2

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