Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

How to display PRINT DIALOG BOX (?)

  Asked By: Abelerd    Date: Aug 22    Category: MS Office    Views: 7202
  

I would like to be able to direct Excel data from a worksheet within an Excel
workbook to the printer.
But, I would like to direct this data to the PRINT DIALOG BOX Panel, so I can
select the printer settings while this panel is displayed.

Can someone please provide the VBA sample code to display the PRINT DIALOG BOX.
I would also like to set the "Selection" item prior to displaying this panel.
Thank you to whomever has the VBA solution.

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Lionel Thomas     Answered On: Aug 22

You may call the print  dialog box  in the following way

Application.Dialogs(xlDialogPrint).Show

check the help for the list of arguments for this specific dialog  box.
for example if you want to preselect the selection, to print X number of
copies, to use collate or not:
application.Dialogs(xlDialogPrint).Show arg12:=True, arg4:=13, arg15:=False

In the above example argument 4 is the number of copies (13), argument 12 is
to preselect "selection" and argument 15 is for collate

hereunder is a copy of the Microsoft help:
xlDialogPrint range_num, from, to, copies, draft, preview,
print_what, color, feed, quality, y_resolution, selection, printer_text,
print_to_file, collate

 
Answer #2    Answered By: Alejandro Smith     Answered On: Aug 22

I found the solution  and it is:

Application.Dialogs(xlDialogPrint).Show arg12:=1

 
Didn't find what you were looking for? Find more on How to display PRINT DIALOG BOX (?) Or get search suggestion and latest updates.




Tagged: