Ted said:
I have created a template document at work where a team of 15 use it to
complete accounting reconciliations. However, when it is printed out each
person has access to modify the print setting and resize the doucment in
various forms. So I was wondering if there is a way to lock this?
This might help. This code should disable all the standard print options.
Set up to print the way you want, then save your file.
Add this code to ThisWorkbook in the VB Editor:
Private Sub Workbook_Activate()
'Disable standard print options & Add Print to Command Bar
Dim MenuObject As CommandBarPopup
'Add Print to Commandbar
posEdit = Application.CommandBars(1).Controls("Edit").Index
Set MenuObject = Application.CommandBars(1).Controls _
..Add(Type:=msoControlPopup, Before:=posEdit, Temporary:=True)
MenuObject.Caption = "&Print"
On Error Resume Next
With Application
'Disable Shortcut Key
.OnKey "^p", ""
'Disable Print Options
.CommandBars("File").FindControl(Id:=4).Enabled = False
.CommandBars("File").FindControl(Id:=247).Enabled = False
.CommandBars("Print Area").FindControl(Id:=364).Enabled = False
.CommandBars("Print Area").FindControl(Id:=1584).Enabled = False
End With
Set MenuItem = MenuObject.Controls.Add(Type:=msoControlButton)
MenuItem.Caption = "Print This"
MenuItem.OnAction = "PrintNow"
End Sub
Private Sub Workbook_Deactivate()
Dim MenuObject As CommandBarPopup
'Delete Print from CommandBar
Set MenuObject = Application.CommandBars(1).Controls("Print")
MenuObject.Delete
On Error Resume Next
With Application
'Enable Shortcut Key
.OnKey "^p"
'Enable Print Options
.CommandBars("File").FindControl(Id:=4).Enabled = True
.CommandBars("File").FindControl(Id:=247).Enabled = True
.CommandBars("Print Area").FindControl(Id:=364).Enabled = True
.CommandBars("Print Area").FindControl(Id:=1584).Enabled = True
End With
End Sub
Add a Module to project with this code:
Sub PrintNow()
ActiveWorkbook.PrintOut
End Sub
HTH Jay