VBA issue : Display a specific page when opening a Visio doc

R

rafilamoule

Hi,
I need to open a Visio document and display for the user a
specific page.

What I've tried :

Dim my_visio as New Visio.Application
set docObj=my_visio.documents.open("my_file.vsd")
set pagesObj=docObj.pages
for index =1 to max_pages
set specificPageObj=pagesObj.item(index)
if specificPageObj.name="page_i_want_to_display" then
!!!!! my problem is there !!!!!!!
end if
next index

The VBA code is working, I browse all the pages of the
document and identify the target one. I can even drop
object and do everithing I want on this page.
But how can I manage with VBA to display the target page
for the user ?
 
C

Chris Roth

You can go through the Window object to display a page.


Dim pgDesired as Visio.Page
set pgDesired = ...get the page object you want...

Visio.ActiveWindow.Page = pgDesired.Name

Note: Window.Page is expecting a string - the page's name, not a page
object.

--

Hope this helps,

Chris Roth
Visio MVP

(e-mail address removed)

Need stencils or ideas? http://www.mvps.org/visio/3rdparty.htm
Need VBA examples? http://www.mvps.org/visio/VBA.htm
Common Visio Questions http://www.mvps.org/visio/common_questions.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top