Manage Learn to apply best practices and optimize your operations.

Disable print command in Microsoft Word

This agent connects to Microsoft Word and disables the Print command in Word.

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("&Print...")        '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

Dig Deeper on Lotus Notes Domino Administration Tools



  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury