Visio Guy

Visio Discussions => Programming & Code => Topic started by: contact_ankit86 on September 27, 2013, 06:32:40 AM

Title: Setting Visio Viewer Zoom to a page
Post by: contact_ankit86 on September 27, 2013, 06:32:40 AM
Hi All,

I am looking for a VBA code that sets a Visio Viewer Zoom to a page.

There is a property .Zoom but this takes a double value. How can i set tit to a page view..?

Any idea..
Title: Re: Setting Visio Viewer Zoom to a page
Post by: Jumpy on September 27, 2013, 08:01:04 AM
Try the Default 0.6 or the special -1 to adjust window to pagesize.
Title: Re: Setting Visio Viewer Zoom to a page
Post by: dgoogle on November 18, 2013, 03:43:45 AM
Try this snipt, it changes all sheets to 'Fit in Page'.


Public Sub FitToPageAll()
    Dim PageToIndex As Visio.Page
    Dim curPage As Visio.Page

    Set curPage = ActivePage

    ' loop through all the pages you have and set the zoom factor
    For Each PageToIndex In ActiveDocument.Pages
        ActiveWindow.Page = ActiveDocument.Pages(PageToIndex.Index).Name
        ActiveWindow.Zoom = -1
    Next
   
    ActiveWindow.Page = curPage
End Sub