Shape

R

RRodrigues

I want to remove all the Shapes that are in the top of InlineShapes, and ONLY
those.
I already have a code that select the InLineShape and format them.
What I can't do, is Delete all the Shapes in the select Paragraph, or in the
InlineShapes.
Can you help me with this?
 
R

RRodrigues

Ok, let me rephrase it.
In my document, I have several pictures.
In some of them, I have drawn some shapes.
Now I want to delete the shapes that are in the top of the pictures.
However, I have also made some shapes in the rest of the document, and I
want to keep these ones.
I guess one of the ways, is selecting the Paragraphs that contain the Inline
Shapes, and then Delete the Shapes in the Selection.
I have already created a code that selects these Paragraphs.
What I need is a code to delete the Shapes that are in this selection.
Can you help me with this?
 
J

Jay Freedman

Use this code:

On Error Resume Next
Selection.Range.ShapeRange.Delete

It will delete any floating shapes but leave inline shapes intact.
(The On Error statement prevents a "Requested object is not available"
error if the paragraph doesn't contain any floating shapes.)

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
R

RRodrigues

Thank you! That was perfect! You're the best!

Jay Freedman said:
Use this code:

On Error Resume Next
Selection.Range.ShapeRange.Delete

It will delete any floating shapes but leave inline shapes intact.
(The On Error statement prevents a "Requested object is not available"
error if the paragraph doesn't contain any floating shapes.)

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
Top