Dawn
Mon May 09 13:16:49 CDT 2005
From Help: (Word 2003)
DocumentBeforePrint Event
Occurs before any open document is printed.
Private Sub object_DocumentBeforePrint(ByVal Doc As Document, Cancel As
Boolean)
object An object of type Application declared with events in a class
module. For more information about using events with the Application object,
see Using Events with the Application Object.
Doc The document that's being printed.
Cancel False when the event occurs. If the event procedure sets this
argument to True, the document isn't printed when the procedure is finished.
Example
This example prompts the user for a yes or no response before printing any
document. This code must be placed in a class module, and an instance of the
class must be correctly initialized in order to see this example work; see
Using Events with the Application Object for directions on how to accomplish
this.
Public WithEvents appWord as Word.Application
Private Sub appWord_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
I could not find anything suitable for AfterPrint
--
Dawn Crosier
Microsoft MVP
"Education Lasts a Lifetime"
This message is posted to a newsgroup. Please post replies and questions to
the newsgroup so that others can learn as well.
"Clint" <Clint@discussions.microsoft.com> wrote in message
news:5F7D61AC-05ED-492B-9AF4-C4EE4532EC3C@microsoft.com...
> Is there a BeforePrint and AfterPrint procedure I can use to set a few
> options before printing??
>
> "Charles Kenyon" wrote:
>
>> I believe you also need to intercept FilePrintDefault.
>> --
>> Charles Kenyon
>>
>> Word New User FAQ & Web Directory:
http://addbalance.com/word
>>
>> Intermediate User's Guide to Microsoft Word (supplemented version of
>> Microsoft's Legal Users' Guide)
http://addbalance.com/usersguide
>>
>> See also the MVP FAQ:
http://www.mvps.org/word which is awesome!
>> --------- --------- --------- --------- --------- ---------
>> This message is posted to a newsgroup. Please post replies
>> and questions to the newsgroup so that others can learn
>> from my ignorance and your wisdom.
>>
>> "Clint" <Clint@discussions.microsoft.com> wrote in message
>> news:061DBB1D-D490-491A-AC56-5E6F80A78CBA@microsoft.com...
>> > When you intercept the print, it only intercepts the File-Print command
>> > but
>> > not the Print Button on the toolbar. Is there another place to place
>> > this
>> > FilePrint code so it does intercept the Print Button on Toolbar???
>> >
>> > "Charles Kenyon" wrote:
>> >
>> >> An intercept, if done well, is virtually invisible to the user. It
>> >> does
>> >> not
>> >> require that the user do anything different in your application to
>> >> achieve
>> >> the results you want.
>> >> --
>> >> Charles Kenyon
>> >>
>> >> Word New User FAQ & Web Directory:
http://addbalance.com/word
>> >>
>> >> Intermediate User's Guide to Microsoft Word (supplemented version of
>> >> Microsoft's Legal Users' Guide)
http://addbalance.com/usersguide
>> >>
>> >> See also the MVP FAQ:
http://www.mvps.org/word which is awesome!
>> >> --------- --------- --------- --------- --------- ---------
>> >> This message is posted to a newsgroup. Please post replies
>> >> and questions to the newsgroup so that others can learn
>> >> from my ignorance and your wisdom.
>> >>
>> >> "Anand.V.V.N" <AnandVVN@discussions.microsoft.com> wrote in message
>> >> news:FB3388C3-1BA3-4B58-A35F-ADB7D0D5D75A@microsoft.com...
>> >> > Hi Charles,
>> >> >
>> >> > I thought it gave the programmer more control and made it very easy
>> >> > for
>> >> > the
>> >> > user, any way why would you say it is more cumbersome than
>> >> > intercepting
>> >> > the
>> >> > print command.
>> >> >
>> >> > Anand
>> >> >
>> >> >
>> >> >
>> >> > "Charles Kenyon" wrote:
>> >> >
>> >> >> Yes, when I said "your solution" I meant the solution you suggested
>> >> >> in
>> >> >> your
>> >> >> posting.
>> >> >> --
>> >> >> Charles Kenyon
>> >> >>
>> >> >> Word New User FAQ & Web Directory:
http://addbalance.com/word
>> >> >>
>> >> >> Intermediate User's Guide to Microsoft Word (supplemented version
>> >> >> of
>> >> >> Microsoft's Legal Users' Guide)
http://addbalance.com/usersguide
>> >> >>
>> >> >> See also the MVP FAQ:
http://www.mvps.org/word which is awesome!
>> >> >> --------- --------- --------- --------- --------- ---------
>> >> >> This message is posted to a newsgroup. Please post replies
>> >> >> and questions to the newsgroup so that others can learn
>> >> >> from my ignorance and your wisdom.
>> >> >>
>> >> >> "Anand.V.V.N" <AnandVVN@discussions.microsoft.com> wrote in message
>> >> >> news:18FC72D1-5205-4F49-A38C-EAA9ACDA40F5@microsoft.com...
>> >> >> > Hi Charles,
>> >> >> >
>> >> >> > Which solution you referrign to by the way? What I typed?
>> >> >> >
>> >> >> >
>> >> >> >
>> >> >> > "Charles Kenyon" wrote:
>> >> >> >
>> >> >> >> Your solution is more cumbersome than intercepting the print
>> >> >> >> command.
>> >> >> >> --
>> >> >> >> Charles Kenyon
>> >> >> >>
>> >> >> >> Word New User FAQ & Web Directory:
http://addbalance.com/word
>> >> >> >>
>> >> >> >> Intermediate User's Guide to Microsoft Word (supplemented
>> >> >> >> version
>&g