Solved

MS Visio, visible portion of diagram

Posted on 2011-09-17
3
394 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 30

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 30

Accepted Solution

by:
Scott Helmers earned 500 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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 …
Scott A. Helmers Partner, Harvard Computing Group Microsoft Visio MVP Background Microsoft has added more enhancements and new features to Visio 2010 than to any release since they purchased the Visio product line in 2000. In addition, the com…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now