Select a Shape by Name

J

John

Hi,

I'm trying to select a named shape from a vb.net application. I'm running
through a list of files and now have the document object:

doc = m_appVisio.Documents.Open(itm.Text)

But if I'm trying to select a shape using the Select method of the Window
object, how do I get the window object in the first place (or am I
approaching this from the wrong angle)?

Any clues?

Best regards

John
 
C

Chris Roth [ Visio MVP ]

m_appVisio.ActiveWindow.Select will get you their.

' Here's a snippet
dim shp as visio.shape
set shp = visio.ActivePage.Shapes.ItemFromID(1) 'assuming our shape is
"Sheet.1"
call visio.ActiveWindow.Select( shp, VisSelectArgs.visSelect)
' note: you should check the ActiveWindow is of type DrawingWindow
' and that the page in the active window is the same page that
' contains the shp we are talking about.

--

Hope this helps,

Chris Roth
Visio MVP
 
J

John

Perfect. Thanks Chris.

Best regards

John
Chris Roth said:
m_appVisio.ActiveWindow.Select will get you their.

' Here's a snippet
dim shp as visio.shape
set shp = visio.ActivePage.Shapes.ItemFromID(1) 'assuming our shape is
"Sheet.1"
call visio.ActiveWindow.Select( shp, VisSelectArgs.visSelect)
' note: you should check the ActiveWindow is of type DrawingWindow
' and that the page in the active window is the same page that
' contains the shp we are talking about.

--

Hope this helps,

Chris Roth
Visio MVP
 

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