![]() |
|
|
|
#1
|
||||
|
||||
|
Documents are made up of a variety of story ranges or 'layers'. Inline graphics are in the text layer and will be accessed with ^g. Images that have a wrap option set are in the graphics layer and thus will not. You need to change the wrap to in-line in order to remove them by this method.
An alternative is to use a macro. The following should remove floating graphics Code:
Sub Macro1()
Dim oShape As Shape
Dim i As Integer
For i = ActiveDocument.Shapes.Count To 1 Step -1
Set oShape = ActiveDocument.Shapes(i)
If oShape.Type = msoPicture Then oShape.Delete
Next i
Set oShape = nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
#2
|
|||
|
|||
|
Thanks so much for the response. I haven't had a lot of experience with running Macros.
I thought I had done everything right, but when I run the Macro you gave me I get a message "Microsoft Visual Basic for Applications. Compile error: Expected End Sub" What have I done wrong? |
|
| Tags |
| deleting, graphics, photos |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Create Word macro to delete text throughout the entire document | JTell | Word VBA | 8 | 07-06-2022 12:19 PM |
Delete entire paragraph after key word
|
jeffreybrown | Word | 2 | 07-27-2018 02:29 PM |
| Single step Word Styles from Source Document through entire Destination document? | xbliss | Word | 6 | 08-27-2016 09:36 PM |
| MS Word auto formats entire document with EVERY change | rooter | Word | 2 | 02-22-2015 10:05 AM |
| New here: How do i delete an entire notebook? | DixieSister | OneNote | 2 | 02-20-2015 12:45 PM |