Evaluate whether shape exists on page one

M

mcwhirt3

Hi,

I have a macro that erases all shapes on a page and basically
restarts a workflow process. However, if no shape exists on the page
the macro fails because it "selects all" shapes and if no shapes exist
it fails. If I could set up a stage of the macro to evaluate whether or
not shape(1) exists on page(1) i could make it skip over the chunk that
looks for shapes all together. I have begun with:

If ActiveDocument.Pages(1).Shapes(1) Is ?does not exist? Then GoTo
skiptwo else continue


I just don't know how to evaluate the existence of an object in the
area between the question marks. Any ideas would be greatly
appreciated. Thanks!
 
M

mcwhirt3

Sorry nevermind. I discovered the on error statement right after
posting this. I just included an:

On error goto skip

this solved my problem.
 
E

Ed Bennett

On error goto skip

Be careful using this statement - it if an error occurs after your skip
label (unless you change your On Error code), you could end up with an
infinite loop.
 

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