Print Dialog Box from VB Code

S

Shashi Bhosale

How do i bring up the Print Dialog Box using VB Code so that user can choose
print and other parameter before printing.

Thanks
 
J

Jay Freedman

Shashi said:
How do i bring up the Print Dialog Box using VB Code so that user can
choose print and other parameter before printing.

Thanks

From VBA code within Word, use

Dialogs(wdDialogFilePrint).Show

If you really mean you're automating Word from an external VB program, you
would have an object (suppose you name it objWd) referring to the Word
application, and then it would be

objWd.Dialogs(Word.wdDialogFilePrint).Show

or (if you haven't set a reference for early binding to the Word object
library) you could define

const wdDialogFilePrint = 88

and use that as the argument.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top