Manage Learn to apply best practices and optimize your operations.

Printing the current document with another form from LotusScript

This tip describes how to print the current document with another form from LotusScript.

Did you ever try to print a document that is currently edited with another form from inside LotusScript? For example, if you provide a button to print part of the document with another formatting than what is currently on screen. Yes, power-user can do that by navigating the menus, but that is usually not the comfort your users expect from your application. Unfortunately, uidoc.print does not allow specifying the form to be used. And, setting the form-field on the document does not help either. There is a solution for this problem, even not that nice as you would wish for, but it works: After changing the form by setting the form-field on the document, you have to open the document in a new window, where it is using the changed form, print it, and close the window, and you are back in the window, where you have started>

Dim workspace As New 
Dim uidoc As NotesUIDocument
Dim Doc As NotesDocument
Dim OldFormName As String

Set uidoc = workspace.CurrentDocument
Call uidoc.refresh
Set Doc=uidoc.Document

Call workspace.EditDocument(False,Doc)
Set uidoc=WorkSpace.CurrentDocument
Call uidoc.Print( 1 )
Call uidoc.close



Dig Deeper on LotusScript



  • iSeries tutorials'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 ...