Detecting view state

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I made a toolbar button with a macro to view two pages in print layout view.
When I'm in Normal view I often forget to switch to Print Layout view first,
and the button returns a VB Debug error. What can I add to the macro code to
detect the view state and switch to Print Layout if it's still in Normal?
Thanks for the help.
 
I made a toolbar button with a macro to view two pages in print layout view.
When I'm in Normal view I often forget to switch to Print Layout view first,
and the button returns a VB Debug error. What can I add to the macro code to
detect the view state and switch to Print Layout if it's still in Normal?
Thanks for the help.

Hi Kamran,

You don't need to detect the view, you just need to insert the command

ActiveWindow.View = wdPrintView

before changing the zoom. If the view was already Print Layout, this
command just won't change anything. If the view was Normal or anything
else except Print Layout, it will change the view.
 
Back
Top