M
Mike Stephenson
I have this application, see, and when a user finishes editing a document, I
want to display all of the pages of the document to them and put up a simple
yes/no dialog. (true, the pages are potentially very small and unreadable, but
the idea is just to give the user a general reassurance that, at a quick glance,
they have not put an errant page break in and left a blank page or something)
If they answer no to the dialog, I want to reset the view's zoom back to
whatever it was previously, which I already stored before I changed the view's
zoom to x pages by y columns..
If they answer yes, I want to set the zoom to page width so anyone else outside
of our company who opens the document won't get some funky zoom by default.
So, I can show all of the pages by setting .PageColumns and .PageRows, and I can
restore the previous view by setting .Percentage to the value that was
previously captured....
BUT, this causes all kinds of issues with the zoom in Word because it is seeming
to "remember" the many-pages view, and when the user performs various actions,
such as maximizing/restoring Word, sometimes switching to another application
and back to Word, etc., Word will set the zoom back to the multiple-page view.
Here is bare-bones macro that exhibits the problem. Interestingly, this was
basically recorded using the macro recorder, yet doing the actions interactively
as a user via the View|Zoom dialog works fine, but running the recorded code
does not work well at all (per the above gripe).
Public Sub Macro1()
With ActiveWindow.ActivePane.View.Zoom
.PageColumns = 2
.PageRows = 2
End With
ActiveWindow.ActivePane.View.Zoom.Percentage = 100
End Sub
If you run this macro, then maximize/restore Word, for example, you will be put
back into a view that shows 4 pages (2 x 2). Word is reverting back to the
..PageColumns and .PageRows setting.
Any ideas? I've verified this on Word2000, WordXP, and Word2003. I've tried
using the Dialogs(wdDialogViewZoom) dialog object but can't seem to get that to
work (I'm not trying to display the dialog, I'm trying to set the values the
same as I did interactively and then call .Execute on the dialog object). Any
help would be greatly, greatly appreciated.
want to display all of the pages of the document to them and put up a simple
yes/no dialog. (true, the pages are potentially very small and unreadable, but
the idea is just to give the user a general reassurance that, at a quick glance,
they have not put an errant page break in and left a blank page or something)
If they answer no to the dialog, I want to reset the view's zoom back to
whatever it was previously, which I already stored before I changed the view's
zoom to x pages by y columns..
If they answer yes, I want to set the zoom to page width so anyone else outside
of our company who opens the document won't get some funky zoom by default.
So, I can show all of the pages by setting .PageColumns and .PageRows, and I can
restore the previous view by setting .Percentage to the value that was
previously captured....
BUT, this causes all kinds of issues with the zoom in Word because it is seeming
to "remember" the many-pages view, and when the user performs various actions,
such as maximizing/restoring Word, sometimes switching to another application
and back to Word, etc., Word will set the zoom back to the multiple-page view.
Here is bare-bones macro that exhibits the problem. Interestingly, this was
basically recorded using the macro recorder, yet doing the actions interactively
as a user via the View|Zoom dialog works fine, but running the recorded code
does not work well at all (per the above gripe).
Public Sub Macro1()
With ActiveWindow.ActivePane.View.Zoom
.PageColumns = 2
.PageRows = 2
End With
ActiveWindow.ActivePane.View.Zoom.Percentage = 100
End Sub
If you run this macro, then maximize/restore Word, for example, you will be put
back into a view that shows 4 pages (2 x 2). Word is reverting back to the
..PageColumns and .PageRows setting.
Any ideas? I've verified this on Word2000, WordXP, and Word2003. I've tried
using the Dialogs(wdDialogViewZoom) dialog object but can't seem to get that to
work (I'm not trying to display the dialog, I'm trying to set the values the
same as I did interactively and then call .Execute on the dialog object). Any
help would be greatly, greatly appreciated.