Capturing the PRINT "Event" 
Author Message
 Capturing the PRINT "Event"

I've got to be able to capture the print "event". By "event" I mean anytime
that the user clicks on the File, Print... menu or any of the print toolbar
buttons. My current approach is to replace the default menu and toolbar
commands with my own procedure (which is the old way of doing it) but before
I do it the "old" way I thought I would ask if anyone out here knew of any
other simpler, sexier ways of doing this.

So, if you had to run some code before anything got printed, regardless of
the method by which the user chose to cause the document to be printed, how
would you do it?



Fri, 07 Mar 2003 03:00:00 GMT  
 Capturing the PRINT "Event"

Hi Bob!
First Solution (sexiest one;-)):
1. Make an addin
2. Insert this line
    Private WithEvents wObj                           As Word.Application
3. Select this new Object in your IDE
Private Sub wObj_DocumentBeforePrint(ByVal DOC As Word.Document, CANCEL As
Boolean)
    >> Put Your Code Here
End Sub
4. Select this
Private Sub IDTExtensibility2_OnConnection(ByVal Application As Object,
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst
As Object, custom() As Variant)
5. Insert this
    Set wObj = Application

Second Solution
1. Make an addin
2. Insert this
    Private WithEvents Button_PrintOut               As
Office.CommandBarButton

3. Select this
Private Sub IDTExtensibility2_OnConnection(ByVal Application As Object,
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst
As Object, custom() As Variant)
4. Insert this
    Set Button_PrintOut = wo.CommandBars.FindControl(, 2521)
5. Select this
Private Sub Button_PrintOut_Click(ByVal Ctrl As Office.CommandBarButton,
CancelDefault As Boolean)

Quote:
>> Put Your Code here

End Sub

How to capture Document-events is even in your vba-help!

Quote:
----- Original Message -----

Newsgroups: microsoft.public.office.developer.vba
Sent: Monday, September 18, 2000 5:59 PM
Subject: Capturing the PRINT "Event"

> I've got to be able to capture the print "event". By "event" I mean
anytime
> that the user clicks on the File, Print... menu or any of the print
toolbar
> buttons. My current approach is to replace the default menu and toolbar
> commands with my own procedure (which is the old way of doing it) but
before
> I do it the "old" way I thought I would ask if anyone out here knew of any
> other simpler, sexier ways of doing this.

> So, if you had to run some code before anything got printed, regardless of
> the method by which the user chose to cause the document to be printed,
how
> would you do it?



> I've got to be able to capture the print "event". By "event" I mean
anytime
> that the user clicks on the File, Print... menu or any of the print
toolbar
> buttons. My current approach is to replace the default menu and toolbar
> commands with my own procedure (which is the old way of doing it) but
before
> I do it the "old" way I thought I would ask if anyone out here knew of any
> other simpler, sexier ways of doing this.

> So, if you had to run some code before anything got printed, regardless of
> the method by which the user chose to cause the document to be printed,
how
> would you do it?



Sun, 09 Mar 2003 14:31:36 GMT  
 Capturing the PRINT "Event"
Sorry!
misconfigurated OE

CU
Volker



Sun, 09 Mar 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Capturing "Edit" Event

2. Loop print "VARIABLE", "VARIABLE"

3. *"*-.,._,.-*"* I"LL TRADE VISUAL C++ FOR VBASIC *"*-.,_,.-*"*

4. Printing without displaying the "Print Dialog"?

5. "Capture" Tab Position

6. Table Caption Name "capture"

7. Capturing SQL Server "Raiserror" in VB

8. Capturing "EMF" files

9. Capturing "EMF" files

10. capture "open in new window"

 

 
Powered by phpBB® Forum Software