Solved

MS Visio, visible portion of diagram

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visio 2013 VBA - How to create a status bar message 6 813
visio 2013 editing 3d cube stencil 3 1,049
Multiple people using one copy of software 5 42
Best free Visio Editor? 2 161
David Parker’s latest book, Microsoft Visio 2010: Business Process Diagramming and Validation, will give you the tools to turn flowcharts and other business diagrams into valuable, data-driven corporate assets. Armed with the knowledge you’ll gain f…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

813 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

13 Experts available now in Live!

Get 1:1 Help Now