Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I count items in a Vision doc

Status
Not open for further replies.

rerhart

Technical User
Aug 13, 2002
5
0
0
US
Is there a method to display a text box or table that 'counts' and then displays in the text box or table the number of certain occurences of a text string within a Visio 'Page'?
Thx!
 
I notice that you haven't yet found any answers that you consider valuable. It's worth reading faq222-2244 to see how to get better answers (and to find how to acknowledge answers)

For this question, add a command button and a textbox to a sheet, and use something like this:
[tt]
Private Sub CommandButton1_Click()
Dim a As Visio.Shape
Dim b As Integer
For Each a In ThisDocument.Pages("MyPageName").Shapes
If a.Text = "fred" Then
b = b + 1
End If
Next
TextBox1.Text = b
End Sub
[/tt]

You'll need to set your own variables and values of course!

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top