List all shapes on a particular page

O

opop

Hi,

I am writing an VBA application that requires that I am able to itemize
all the shapes on any particular page say the active page or a page
named by its page number. I have found that the selection function
selects all the shapes in the document, is this possible.

I would appreciate any help

Thanks
Adejare
 
H

Helmut Weber

Hi Adejare,

like this:

Sub Test4454()
ActiveDocument.GoTo _
what:=wdGoToPage, _
which:=wdGoToAbsolute, _
Count:=3
MsgBox selection.Bookmarks("\page").Range.ShapeRange.Count
End Sub

The msgbox should show the number of shapes on page 3.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
O

opop

Hi Helmut,

This works perfectly.

One last question, is there a shape change event? ie I would like to
monitor if an attribute of a shape changes.

Adejare
 
H

Helmut Weber

Hi Adejare
One last question, is there a shape change event? ie I would like to
monitor if an attribute of a shape changes.

not to my knowledge.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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