Print Preview Macro

  • Thread starter Thread starter Harry
  • Start date Start date
H

Harry

As part of a formatting macro, I have print preview come
up using ActiveWindow.SelectedSheets.PrintPreview

While still in Print Preview, I want a yes no pop up box
to come up that asks if it is okay to print, if yes then
it prints by ActiveWindow.SelectedSheets.PrintOut
Copies:=1, Collate:=True

If no it returns to document and goes to cell A1.

All I can get is the print preview has to be manually
closed and then the pop box comes up.

Can I get the pop up box to come up in print preview?
What is code for escape or close print preview?
Can the macro be run while in print preview?

Thanks very much
 
I hate to be the bearer of bad news, but I think that macro execution is
suspended while in print preview. So you probably cannot do any of the
things you want. If you take the user to print preview he has to know to
click Print or Quit. Probably not asking too much.

At least you can keep the user from changing page setup if you want with:

Sheet1.PrintPreview EnableChanges:=False
 
While still in Print Preview, I want a yes no pop up box
to come up that asks if it is okay to print, if yes then
it prints by ActiveWindow.SelectedSheets.PrintOut
Copies:=1, Collate:=True

You can't do this using VB. You'll have to use another macrocommand
program. VB loses control once you go into the print preview box; you'll
need a system-level macro program to display a dialog box and take the
requested action.

I'm a happy user of Macro Express ( http://www.macros.com/ ) but have no
other affiliation with them.
 

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

Back
Top