Visio Guy

Visio Discussions => General Visio => Topic started by: k-man on June 02, 2008, 01:45:34 PM

Title: Default Zoom Level in Visio Standard 2003
Post by: k-man on June 02, 2008, 01:45:34 PM

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
Title: Re: Default Zoom Level in Visio Standard 2003
Post by: Visio Guy on June 02, 2008, 01:51:29 PM
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.
Title: Re: Default Zoom Level in Visio Standard 2003
Post by: k-man on June 02, 2008, 02:34:12 PM

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
Title: Re: Default Zoom Level in Visio Standard 2003
Post by: k-man on June 02, 2008, 03:55:29 PM
I found this article by googling:

http://visualsignals.typepad.co.uk/vislog/2008/04/synchronizing-p.html

I think it will come to help!
Title: Re: Default Zoom Level in Visio Standard 2003
Post by: 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
Title: Re: Default Zoom Level in Visio Standard 2003
Post by: k-man on June 03, 2008, 11:41:52 AM
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!
Title: Re: Default Zoom Level in Visio Standard 2003
Post by: Visio Guy on June 03, 2008, 02:05:41 PM
Quote from: k-man on June 02, 2008, 02:34:12 PM
Thank you Visio Guy for the prompt reply!
You should really consider that "buy me a beer"-app  :)

:)  Reward Helpful Posters With "Buy Me a Beer" Donation (http://visguy.com/vgforum/index.php?topic=113.msg419#msg419)  :)
Title: Re: Default Zoom Level in Visio Standard 2003
Post by: k-man on June 04, 2008, 11:15:02 AM
Quote from: Visio Guy on June 03, 2008, 02:05:41 PM
Quote from: k-man on June 02, 2008, 02:34:12 PM
Thank you Visio Guy for the prompt reply!
You should really consider that "buy me a beer"-app  :)

:)  Reward Helpful Posters With "Buy Me a Beer" Donation (http://visguy.com/vgforum/index.php?topic=113.msg419#msg419)  :)

enjoy your beers guys!  ;D
Title: Re: Default Zoom Level in Visio Standard 2003
Post by: Lars-Erik on June 04, 2008, 11:37:19 AM
I sure will! Thanks!
Title: Re: Default Zoom Level in Visio Standard 2003
Post by: Visio Guy on June 04, 2008, 12:01:17 PM
Thanks K-man!

*Glurp*