Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-26-2018, 09:38 PM
gmayor's Avatar
gmayor gmayor is offline Execute VBA before printing Windows 10 Execute VBA before printing Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You need two macros to intercept the Print commands in the document template e.g.

Code:
Sub FilePrintDefault()
Dim Result As Long
    Result = MsgBox("Text", vbYesNo)
    If Result = vbNo Then
        Exit Sub
    Else
        ActiveDocument.PrintOut
    End If
End Sub

Sub FilePrint()
Dim Result As Long
    Result = MsgBox("Text", vbYesNo)
    If Result = vbNo Then
        Exit Sub
    Else
        ActiveDocument.PrintOut
    End If
End Sub
However it will only work if the user has access to the template with the macros.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Execute VBA before printing Why does this Macro take so long to execute? poetofpiano Word VBA 3 09-30-2017 11:59 PM
Execute autocorrects? KaiserD2 Word 6 04-03-2017 10:18 PM
Execute VBA before printing Execute VBA on File Import npalmer610 Word VBA 1 04-12-2016 06:01 PM
Execute VBA before printing word 2010 mail merge execute twice smaddi Mail Merge 1 02-05-2012 02:45 AM
Execute VBA before printing Find and Execute cksm4 Word VBA 1 10-22-2011 11:36 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft