Is there a way to return the number of pages in a document & the number & name of shapes in a Partic

J

Jason

A Good Day to Ya All,

Would anyone be aware of the method to get the number of pages in a
document?
Also I wish to find the number and name of any shapes on a page within a
given layer?
VBA is the lanugage of choice if you have any examples :)

Best Regards,
M@
 
S

Scott Metzger

Jason said:
A Good Day to Ya All,

Would anyone be aware of the method to get the number of pages in a
document?
Document.Pages.Count

Also I wish to find the number and name of any shapes on a page within a
given layer?

Dim i As Integer
Dim iShapeCount As Integer
Dim shpsObj As Visio.Shapes

Set shpsObj = ActiveDocument.Pages.Item(1).Shapes

Debug.Print "Shape Name List For Document : "; ActiveDocument.Name
Debug.Print " Page : ";
ActiveDocument.Pages.Item(1).Name

iShapeCount = shpsObj.Count

If iShapeCount > 0 Then
For i = 1 To iShapeCount
Debug.Print " "; shpsObj.Item(i).Name
Next i
Else
Debug.Print " No Shapes On Page"
End If

You'll need to get the Layer from each individual Shape.
 

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