how do I search for the text box object in visio diagrams

S

scott

I have many hundreds of visio digrams which have text comments throughout
(inserted using the standard text tool). I am not interested in searching for
specific text but just the occurence of the text box itself.

Any clues would be appreciated.
Thanks
 
P

Philippe C.

I had a look in Visio 2003.
The
Select by Type and
Find - any character - go far, but not far enough for your purpose.
I'm afraid you'll have to save the file in XML format and do your thing there.
 
J

John Goldsmith

Hello Scott,

I can't think of a non-code method so a code route would be as follows:

First choose the basis on which you want to search. The standard text tool
just creates a normal shape with no visible geometry and Line and Fill
patterns set to none, so you could search for that plus the text:

Public Sub SearchForTextShapes()
Dim shp As Shape
Dim pag As Page

For Each pag In ActiveDocument.Pages
For Each shp In pag.Shapes
If shp.GeometryCount = 1 Then
If shp.CellsU("LinePattern").ResultIU = 0 _
And shp.CellsU("FillPattern").ResultIU = 0 Then
Debug.Print "Shape ID = " & shp.ID, _
"Text = " & shp.Text
End If
End If
Next shp
Next pag

End Sub

The above will print a list of text shapes text to the Immediate window (VBE
/ View / Immediate Window).

If you've not tried using code before then you might find the following blog
posts handy:

http://visualsignals.typepad.co.uk/vislog/2007/10/just-for-starte.html

http://visualsignals.typepad.co.uk/vislog/2007/11/looping-through.html

Hope that helps.

Best regards

John


John Goldsmith
www.visualSignals.typepad.co.uk
www.visualSignals.co.uk
 
P

Philippe C.

Or a little VBA.

Philippe C. said:
I had a look in Visio 2003.
The
Select by Type and
Find - any character - go far, but not far enough for your purpose.
I'm afraid you'll have to save the file in XML format and do your thing there.
 

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