About This Code
Brief Description:
Print without Recipients
Contributor:
Dennis Henry
Last Modified:
13 Feb 2003
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
This code allows the user to select an action for printing an email without recipient information. This requirement came from users receiving emails with large recipient lists.
Usage / Example
Agent: PrintwithoutRecipients
Description: Makes a copy of the current ui document, clears the recipients (SendTo, BlindCopyTo and EnterCopyTo), and sets the saveoptions field to 0 to not allow the document to be saved, then launches the print dialog. Once the print dialog is closed the copied document is closed returning the user to the start point.
Sub Initialize
Dim ws As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim thisdoc As NotesDocument
Dim copydoc As NotesDocument
'This captures the current document
Set uidoc = ws.CurrentDocument
'This takes it to the backend
Set thisdoc = uidoc.Document
'This sets the db to the current db
Set db = session.CurrentDatabase
'This creates the copydoc
Set copydoc = New NotesDocument ( db )
'This copy's the values of all of the fields from the document to the copy document
Call thisdoc.CopyAllItems( copydoc, True )
'This saves the new copy doc
' Call copydoc.Save( True, True )
copydoc.SaveOptions = 0
copydoc.EnterSendTo = ""
copydoc.SendTo = ""
copydoc.EnterCopyTo = ""
copydoc.tmpEnterCopyTo = ""
copydoc.CopyTo = ""
copydoc.EnterBlindCopyTo = ""
copydoc.tmpEnterBlindCopyTo = ""
copydoc.BlindCopyTo = ""
Set uidoc = ws.EditDocument(True,copydoc,False)
uidoc.Refresh
uidoc.Print
uidoc.Close
End Sub
New Shared Action: Print without Recipients
@Command([ToolsRunMacro]; "PrintwithoutRecipients")
Shared Action added to Forms:
Memo
Reply