Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-15-2010, 12:31 PM
maruapo maruapo is offline DocumentBeforePrint not working Windows 7 DocumentBeforePrint not working Office 2007
Novice
DocumentBeforePrint not working
 
Join Date: Jun 2010
Posts: 2
maruapo is on a distinguished road
Default DocumentBeforePrint not working

I'm trying to force a dialog box to appear when users press Print. I know all about DocumentBeforePrint, but despite scouring the Net and double-triple-quadruple checking my code, my code doesn't err out but it doesn't work either. I've created a Class Module called "EventClassModule" and referenced it in a Module. Could it be related to my being on a huge corporate network and the printers are shared? I'm out of ideas; this code should work. Why doesn't it?

Here's what's in my 'regular' module:
Sub Register_Event_Handler()
Dim x As New EventClassModule
Set x.v = Word.Application
End Sub
Here's what's in the Class Module:
Public WithEvents v As Word.Application
Private Sub v_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
Dim intResponse As Integer
intResponse = MsgBox("Have you checked the " _
& "printer for letterhead?", _


vbYesNo)
If intResponse = vbNo Then Cancel = True

End Sub
Reply With Quote
Reply

Tags
class module, documentbeforeprint, macro

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spellchecker not working GR8Fandini Word 6 02-07-2010 01:12 PM
DocumentBeforePrint not working Tab key stopped working in Word jgriffin Word 2 06-24-2009 04:05 PM
How to get Word working? AllanZhou Office 3 06-23-2009 12:42 AM
working with html kate1234 Word 0 09-22-2008 05:02 PM
DocumentBeforePrint not working Excell stopped working TomC Excel 4 05-26-2006 11:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:10 PM.


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