Delete Horizontal Lines

S

Steve

How can I delete horizontal lines from a document?

The following doesn't find horizontal lines:
Dim sShape As Shape
' Delete all the shapes
For Each sShape In ActiveDocument.Shapes
sShape.Delete
Next sShape

This doesn't work because ils doesn't support the Delete method:
Dim ils As InlineShapes
For Each ils In ActiveDocument.InlineShapes
ils.Delete ' Fails. No Delete method
Next ils

Thanks
Steve
 
D

Doug Robbins - Word MVP

Hi Steve,

Your problem is you are declarings ils as InLineShapes rather than
InLineShape

Use

Dim ils As InlineShape
For Each ils In ActiveDocument.InlineShapes
ils.Delete ' The inlineShape object has a Delete method
Next ils


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
S

Steve

Thanks, Doug. Oops.

Doug Robbins - Word MVP said:
Hi Steve,

Your problem is you are declarings ils as InLineShapes rather than
InLineShape

Use

Dim ils As InlineShape
For Each ils In ActiveDocument.InlineShapes
ils.Delete ' The inlineShape object has a Delete method
Next ils


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
"Steve" <> wrote in message news:u8%[email protected]...
 

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