View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default How to delete a drawing shape object from all pages in one click.

The macro below will remove _all_ AutoShape lines (i.e. lines created using
the Line tool in the Drawing toolbar) from the _main body_ of you document if
you make sure the insertion point is in the main body when you start the
macro (lines in e.g. the header or footer will not be removed).

Sub DeleteAllLines()

Dim oShape As Shape
Dim n As Long

n = 0
For Each oShape In ActiveDocument.Shapes
With oShape
If .Type = msoLine Then
oShape.Delete
n = n + 1
End If
End With
Next oShape

MsgBox "Finished deleting " & n & " lines."

End Sub

Before running the macro, you should save a copy of your document.

If you need help with installing macros, see:
http://www.gmayor.com/installing_macro.htm

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"(¯`€¢Â¸Rღjღ¸€¢Â´Â¯)" wrote:

I have a drawing shape object (Line) on each page of my document and i want
to remove all of them. I have 300 pages and deleting one by one will take ma
whole day so please tell me if there is any method to get rid of it in one
go...
I'll be very thankful to you for your quick response...

Thanks.


Engr. Abu Adal
Network Engineer