Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
hans hans is offline
external usenet poster
 
Posts: 72
Default Need to delete autoshapes

I have a document with 1,000+ Autoshapes. I need to get the Autoshapes out of
the doc because, though they are supposed to be WHITE and therefore NOT
PRINT, they are printing BLACK!! (They are not visible on-screen.)

Is there a way to globally search/replace or search/delete Autoshapes?

They are not in the header/footer. I stupidly used Autoshapes (lines) as
layout guides in a mail merged doc that, now print-ready, is 500 pages long
and which cannot be rebuilt without considerable effort because many of the
merge fields have been converted to images, many of which, in turn, were
manually arranged.

THANK YOU!
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default Need to delete autoshapes

On Tue, 15 Dec 2009 13:34:02 -0800, Hans
wrote:

I have a document with 1,000+ Autoshapes. I need to get the Autoshapes out of
the doc because, though they are supposed to be WHITE and therefore NOT
PRINT, they are printing BLACK!! (They are not visible on-screen.)

Is there a way to globally search/replace or search/delete Autoshapes?

They are not in the header/footer. I stupidly used Autoshapes (lines) as
layout guides in a mail merged doc that, now print-ready, is 500 pages long
and which cannot be rebuilt without considerable effort because many of the
merge fields have been converted to images, many of which, in turn, were
manually arranged.

THANK YOU!


Use the following macro (see
http://www.gmayor.com/installing_macro.htm if needed):

Sub DeleteAutoShapes()
Dim oShp As Shape
Dim nCount As Long

For nCount = ActiveDocument.Shapes.Count To 1 Step -1
Set oShp = ActiveDocument.Shapes(nCount)
If oShp.Type = msoAutoShape Then
oShp.Delete
End If
Next
End Sub

I'd recommend making a backup copy of the document first (in addition
to the backup that I'm sure you already have...)

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Need to delete autoshapes

Use a macro containing the following code:

Dim i As Long
With ActiveDocument
For i = .Shapes.Count To 1 Step -1
If .Shapes(i).Type = msoAutoShape Then
.Shapes(i).Delete
End If
Next i
End With


--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.

"Hans" wrote in message
...
I have a document with 1,000+ Autoshapes. I need to get the Autoshapes out
of
the doc because, though they are supposed to be WHITE and therefore NOT
PRINT, they are printing BLACK!! (They are not visible on-screen.)

Is there a way to globally search/replace or search/delete Autoshapes?

They are not in the header/footer. I stupidly used Autoshapes (lines) as
layout guides in a mail merged doc that, now print-ready, is 500 pages
long
and which cannot be rebuilt without considerable effort because many of
the
merge fields have been converted to images, many of which, in turn, were
manually arranged.

THANK YOU!


  #4   Report Post  
olegnaumov olegnaumov is offline
Junior Member
 
Posts: 0
Default

Thanks for the code! It works well, but for some reason it fails to delete Autoshapes placed inside Drawing Canvas. Could you help with that?
  #5   Report Post  
olegnaumov olegnaumov is offline
Junior Member
 
Posts: 0
Default

Quote:
Originally Posted by olegnaumov View Post
It works well, but for some reason it fails to delete Autoshapes placed inside Drawing Canvas. Could you help with that?
Update:

Never mind! Here's the code:
Code:
Dim oShp As Shape
Dim oFrm As InlineShape

Dim nCount As Long


For nCount = ActiveDocument.Shapes.Count To 1 Step -1
    Set oShp = ActiveDocument.Shapes(nCount)
   
    If oShp.Type = msoAutoShape Then
        oShp.Delete
    Else
        If oShp.Type = msoCanvas Then
            For i = oShp.CanvasItems.Count To 1 Step -1
                If oShp.CanvasItems(i).Type = msoAutoShape Then
                    oShp.CanvasItems(i).Delete
                End If
            Next i
        End If
    End If
    
    MsgBox ("Job's done!")
Next nCount
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Autoshapes and text marf Microsoft Word Help 1 June 6th 08 02:51 PM
autoshapes and layouts. woodyuk Microsoft Word Help 2 February 28th 08 06:46 PM
watermarks and Autoshapes woodyuk Microsoft Word Help 1 February 28th 08 02:46 PM
How do I move autoshapes J Penney Microsoft Word Help 3 December 1st 06 02:14 PM
Autoshapes in Table question Mike Hyndman New Users 2 January 28th 05 06:13 PM


All times are GMT +1. The time now is 12:02 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"