Reference a Shape's Text

L

lq495

How do you get a shape's text into a variable, when the shape is located on a
different page? I've played around with
Dim vsoCharacters1 As Visio.Characters
vsoCharacters1 =
Application.ActiveWindow.Page(PageName).Shapes.ItemFromID(50).Text
but it only returns "Out of Context"
 
P

Paul Herber

How do you get a shape's text into a variable, when the shape is located on a
different page? I've played around with
Dim vsoCharacters1 As Visio.Characters
vsoCharacters1 =
Application.ActiveWindow.Page(PageName).Shapes.ItemFromID(50).Text
but it only returns "Out of Context"

dim strText as string
strText = Application.ActiveDocument.Page(PageName).Shapes.ItemFromID(50).Text
 
L

lq495

Thanks for your help! The macro recorder saved the day again -here's what was
needed to get that value

Sub GetShapeText()

Application.ActiveWindow.Page =
Application.ActiveDocument.Pages.ItemU("PageName")
Dim vsoCharacters1 As Visio.Characters
Set vsoCharacters1 =
Application.ActiveWindow.Page.Shapes.ItemFromID(50).Characters

End Sub
 

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