Solved

MS Visio, visible portion of diagram

Posted on 2011-09-17
3
425 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

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…
Book Review: Using Microsoft Visio 2010 by Chris Roth   Disclaimer: The author of Using Visio 2010 is a friend and fellow Visio MVP. Whether you’re new to Visio or are upgrading to Visio 2010 from a previous version, you will find a lot to like…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Suggested Courses

632 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