views:

46

answers:

1

Hi guys

I am needing to set-up a function in MS Word to run a message box when a user tries to print a particular file.

Cheers Anthony

Update -

I haven't done any VBA before and am trying to help out someone who need this. What they need is a message box with some text to display when the user goes to print this particular document. This is what they have done so far, but I'm not sure if they know where to hook it in or if this will work.

Private Sub AppThatLooksInsideThisEventHandler_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
    MsgBox "Event: DocumentBeforePrint"
End Sub
+1  A: 

I've not tried this myself, the event you are looking for should be:
Application.DocumentBeforePrint (this is for Word 2003, not sure about 2007)

This is a related reference:
Solved: DocumentBeforePrint help needed

o.k.w
Thanks that did the trick for them.
vdh_ant