Default Zoom Level in Visio Standard 2003

Started by k-man, June 02, 2008, 01:45:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

k-man


Dear Visio Guy and Visio users,

I'm running Visio Standard 2003 and I have an issue with zoom levels.

Let me explain:
I change the zoom level on a page (zoom in or zoom out) while working with a vsd file.
Then I close the file and open it again. I go to the same page and the zoom level is the same as when I closed the document.

My question is: Is there a way to set a zoom level, let's say 80% for all pages in a vsd file and disable the property that makes Visio
remember the zoom level settings?

I'd be greatful for any tips and suggestions on this one!

Cheers K-Man

Visio Guy

K-man,

There is a way to save a "workspace", which remembers window positions, open files, etc.

I think in Visio 2003, you find it like this: File > Save As. The Save button is actually a drop-down, with a workspace check item.

In 2007, there's a Workspace checkbox under File > Properties.

You could write a fairly simple VBA script to zoom all the pages in the document, but I find this works better:

Ctrl + W

This will zoom-to-fit your page in the window.
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

k-man


Thank you Visio Guy for the prompt reply!
You should really consider that "buy me a beer"-app  :)

Hmmm, the work space toggle is great so Visio remembers your window setup and all but it still won't do
what I'm looking for...

You could of course, after you have made your changes to the document, press  Ctrl + W on every page and then save the document.
But that will be a lot of work if you have a large number of pages in the document... The best solution in my case would be
a tiny "on save" VB script that sets all pages in the document to a defined zoom level and goes to the "index page".

I have hardly any programming experience but maybe you can tell me if i'm on the correct path?

Private Sub Document_DocumentSaved(ByVal doc As IVDocument)
ZoomBehavior = visZoomInPlaceContainer
End Sub

/K


Lars-Erik

If you are willing to use code...

Private Sub Document_BeforeDocumentSave(ByVal doc As IVDocument)
Count = Application.ActiveDocument.Pages.Count
    For i = 1 To Count
    ActiveWindow.Page = Application.ActiveDocument.Pages.Item(i)
    Application.ActiveWindow.ViewFit = visFitPage
    Next
End Sub
Private Sub Document_BeforeDocumentSaveAs(ByVal doc As IVDocument)
Count = Application.ActiveDocument.Pages.Count
    For i = 1 To Count
    ActiveWindow.Page = Application.ActiveDocument.Pages.Item(i)
    Application.ActiveWindow.ViewFit = visFitPage
    Next
End Sub


That will do it. Note that there is no error checking, nor will it see if a page is a foreground of background page. When saving or saving as it will set ALL pages to fit zoom level.

- Lars

k-man

Quote from: Lars-Erik on June 03, 2008, 09:55:24 AM
If you are willing to use code...

Private Sub Document_BeforeDocumentSave(ByVal doc As IVDocument)
Count = Application.ActiveDocument.Pages.Count
    For i = 1 To Count
    ActiveWindow.Page = Application.ActiveDocument.Pages.Item(i)
    Application.ActiveWindow.ViewFit = visFitPage
    Next
End Sub
Private Sub Document_BeforeDocumentSaveAs(ByVal doc As IVDocument)
Count = Application.ActiveDocument.Pages.Count
    For i = 1 To Count
    ActiveWindow.Page = Application.ActiveDocument.Pages.Item(i)
    Application.ActiveWindow.ViewFit = visFitPage
    Next
End Sub


That will do it. Note that there is no error checking, nor will it see if a page is a foreground of background page. When saving or saving as it will set ALL pages to fit zoom level.

- Lars


Spot on!
Works great, thanks a lot Lars-Erik!

Visio Guy

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

k-man


Lars-Erik


Visio Guy

For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010