?
Solved

MS Visio, visible portion of diagram

Posted on 2011-09-17
3
Medium Priority
?
433 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 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

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 containers. We’ll explore lists (http://www.experts-exchange.com/Microsoft/Applications/M…
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, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

719 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