This agent connects to Microsoft Word and disables the Print command in Word. It is done through Lotusscript. To...
enable the Print command, you need to set the control enable property to true.
'This script disables the print command in Menubar of Microsoft word Sub Initialize Dim xlFilename As String Dim session As New NotesSession xlFilename="C:\Book2.doc" 'Any word document to be opened Dim db As NotesDatabase Dim doc As NotesDocument Dim w As New NotesUIWorkspace Dim WordDocs As Variant Dim WordDoc As Variant Dim oMainMenuBar As Variant 'Handle of the Word Menubar Dim submenu As Variant 'Handle of the Print command in the Menubar Dim submenu1 As Variant Dim control1 As Variant Dim control2 As Variant Dim object As Variant Dim WordObj As Variant Dim prints As Variant Dim workspace As New NotesUIWorkspace Dim uidoc As NotesUIDocument Set uidoc = workspace.CurrentDocument Set db = session.CurrentDatabase Set WordObj = CreateObject("Word.Application") 'Create a word object WordObj.visible = True 'To make the word document visible Set WordDocs = WordObj.Documents Print "Opening.." & xlFilename &"...." WordObj.Documents.Open xlFilename 'Opens the required filename Set WordDoc = WordObj.ActiveDocument Set oMainMenuBar = WordObj.CommandBars.Item("Menu Bar") Set submenu=oMainMenuBar.Controls("&File") 'Initializes with the menubar control ' Set submenu1=oMainMenuBar.Controls("&Edit") Set control1=submenu.Controls("⪻int...") 'Initializes with the Print control ' Set control2=submenu.Controls("&Close") control1.Enabled=False 'Set to false disables the command on the Menubar ' control2.Enabled=True End Sub