Dim workspace As New NotesUIWorkspace Dim session As New NotesSession Dim db As NotesDatabase Dim uidoc As NotesUIDocument Dim item As NotesItem Set db = session.CurrentDatabase Set uidoc = workspace.CurrentDocument Set doc = uidoc.Document 'prep If uidoc.EditMode Then Call doc.Save ( True, True) 'was uidoc.Save 'switch to view with "Requistion Print" form doc.SaveOptions = 0 doc.Form = "FORM" Set uidoc = workspace.EditDocument (True, doc, False) Set doc = uidoc.Document 'print Call uidoc.Print 'restore to normal Call uidoc.Close 'save minor changes Set uidoc = workspace.EditDocument (True, doc, False) Set doc = uidoc.Document doc.SaveOptions = 1 Set item = doc.ReplaceItemValue ( "reqR_Printed", "Yes" ) doc.Form = "Requisition" Call uidoc.Refresh Call doc.Save( True, True) Call uidoc.Close 'print the child documents Dim parentdoc As NotesDocument Dim childdoc As NotesDocument Dim responses As NotesDocumentCollection Set parentdoc = workspace.CurrentDocument.Document Set responses = parentdoc.Responses For i = 1 To responses.Count 'loop thru the links Set childdoc = responses.GetNthDocument(i) Set uidoc = workspace.EditDocument( False, childdoc ) Call uidoc.Print Call uidoc.Close Next End Sub
Call notesUIDocument.Print( [ numCopies%, [, fromPage%, [, toPage%, [,draft ]]]] )
See the Developer help file for more details.
Do you have comments on this Ask the Expert question and response? Let us know.
Dig Deeper on Lotus Notes Domino Application Development
Related Q&A from Brian Mahoney
Find out what types of calculations can be computed for a column in a Lotus Notes view and the best way to go about it with this expert response. Continue Reading
Find out why you can't use Formula language to include a doclink to a specific Lotus Notes view or database and need to use LotusScript instead. Continue Reading
Discover the reasons behind a Notes/Domino admistrator having trouble with disabled options in the "customize this view" section of his Lotus Notes ... Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.