Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / March 2008

Tip: Looking for answers? Try searching our database.

Macro for deleting mult. pictures in word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Howard Irwin - 04 Mar 2008 16:44 GMT
I need a macro for deleting multiple pictures (over 400) in a 2003 word
document.
Signature

Howard Irwin

Jean-Guy Marcil - 04 Mar 2008 16:51 GMT
> I need a macro for deleting multiple pictures (over 400) in a 2003 word
> document.

What Word version?

Do you want to delete all pictures in the document or just some of them?
Are all pictures floating or inline with text, or a mix?
Why do you need a macro? Are you going to do this often?

Have you tried writing the macro? Do you have any code?
Jay Freedman - 04 Mar 2008 16:53 GMT
> I need a macro for deleting multiple pictures (over 400) in a 2003
> word document.

You don't need a macro for this.

Open the Replace dialog and click the More button. Click the Special button
at the bottom and choose "Graphic" from the popup menu. This places the code
^g  in the Find What box. Leave the Replace With box empty and click the
Replace All button.

Signature

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.

Jay Freedman - 04 Mar 2008 17:04 GMT
>> I need a macro for deleting multiple pictures (over 400) in a 2003
>> word document.
[quoted text clipped - 5 lines]
> places the code ^g  in the Find What box. Leave the Replace With box
> empty and click the Replace All button.

I have to (possibly) overrule myself -- this will remove only in-line
graphics, not floating ones.

Signature

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.

Jean-Guy Marcil - 04 Mar 2008 17:06 GMT
> > I need a macro for deleting multiple pictures (over 400) in a 2003
> > word document.
[quoted text clipped - 5 lines]
> ^g  in the Find What box. Leave the Replace With box empty and click the
> Replace All button.

Any way to make this work with floating gaphics? Or am I missing someting
easy (again!)?
Jay Freedman - 04 Mar 2008 17:37 GMT
>>> I need a macro for deleting multiple pictures (over 400) in a 2003
>>> word document.
[quoted text clipped - 8 lines]
> Any way to make this work with floating gaphics? Or am I missing
> someting easy (again!)?

No, I think floating graphics will require a macro. This works, but only for
graphics in the main body of the document:

Sub demo()
   Dim oShp As Shape
   Dim oIShp As InlineShape

   For Each oShp In ActiveDocument.Shapes
       oShp.Delete
   Next

   For Each oIShp In ActiveDocument.InlineShapes
       oIShp.Delete
   Next
End Sub

If there are also graphics in headers, footers, and other stories, the usual
folderol is needed
(http://www.word.mvps.org/FAQs/MacrosVBA/FindReplaceAllWithVBA.htm).

Signature

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.


Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.