
Count occurances of a character string?
Jerry,
You could write a VBA macro to handle this. Two things to keep in mind:
A shape object has a .Text property that you can analyze. For instance
Dim visShp as Visio.Shape
For Each visShp in ActivePage.Shapes
MsgBox visShp.Text
Next
If a shape is a group, you may have to recurse through the member shapes to
find more text.
Sub RecurseText( visShp as Visio.Shape )
Dim visShpSub as Visio.Shape
MsgBox visShp.Text
If visShp.Type = -group- Then 'Find actual visConst
for type group...
For Each visShpSub in visShp.Shapes
Call RecurseText( visShpSub ) 'Recurse
visShp.Shapes
Next
End if
End Sub
Hope this helps,
Chris Roth
Visio MVP
Quote:
> Hi,
> I want to count the occurances of a text string in a visio
> drawing. I am currently counting the number of times I do
> a 'Find Next' command.
> Thanx,
> Jerry