Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MS Visio, visible portion of diagram

Posted on 2011-09-17
3
Medium Priority
?
439 Views
Last Modified: 2012-05-12
Hi Experts,

I am generating a large VISIO diagram.  On completion, I would like to have the top-left portion of the diagram in view. How can I do this from my VBScript code?

Please advise.
0
Comment
Question by:AnwaPeck
  • 2
3 Comments
 
LVL 31

Expert Comment

by:Scott Helmers
ID: 36556454
The code below sets the viewing rectangle. You can experiment with the parameters, especially width and height, to get the size you need.
Sub SetViewingArea()

    Dim dLeft As Double, dTop As Double, dWidth As Double, dHeight As Double

    dLeft = 0
    dTop = ActivePage.PageSheet.CellsU("PageHeight").ResultIU
    dWidth = 6
    dHeight = 4
    
    Application.ActiveWindow.SetViewRect dLeft, dTop, dWidth, dHeight
    
End Sub

Open in new window

0
 
LVL 31

Accepted Solution

by:
Scott Helmers earned 2000 total points
ID: 36557884
Two additional thoughts: 1) The ResultIU property returns a value in "internal units" and Visio's internal units are expressed in inches. 2) The default units for a diagram based on a US units is inches, consequently, all dimensions in the code sample above are in inches.
0
 

Author Closing Comment

by:AnwaPeck
ID: 36558422
Thank You Scott!

Works perfectly.

Regards, Anwa
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Question Several times in recent years, someone has posted a question at EE asking whether they could display the Windows directory structure – folders and subfolders – using Visio. When one person specifically asked about displaying directory …
The ability to add structure to Visio diagrams using containers, lists and callouts is one of my favorite features in Visio 2010. In this article we’ll examine lists. We’ll explore containers and callouts in separate articles. Prior to reading th…
Loops Section Overview
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question