#1
|
|||
|
|||
Copy everything except pictures?
I have many pictures in the background of my document and want to copy the text and tables only. I can see the option to paste text only, but not the option to past text and tables. Is there a way to remove all pictures and keep both text and tables?
|
#2
|
||||
|
||||
You could make a copy of the document and then run a macro which removes all images, shapes and objects.
Code:
Sub RemoveAllObjectsFromFile() 'Macro created by Stefan Blom, MVP, April 2020 Dim ShapeCount As Long Dim InlineShapeCount As Long Dim i As Long Dim j As Long ShapeCount = ActiveDocument.Shapes.Count InlineShapeCount = ActiveDocument.InlineShapes.Count For i = ShapeCount To 1 Step -1 ActiveDocument.Shapes(i).Delete Next i For j = InlineShapeCount To 1 Step -1 ActiveDocument.InlineShapes(j).Delete Next j End Sub
__________________
Stefan Blom Microsoft Word MVP Microsoft 365 apps for business Windows 11 Professional |
#3
|
||||
|
||||
Simpler and faster:
Code:
Sub RemoveAllObjectsFromFile() Application.ScreenUpdating = False With ActiveDocument While .Shapes.Count > 0: .Shapes(1).Delete: Wend While .InlineShapes.Count > 0: .InlineShapes(1).Delete: Wend End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#4
|
|||
|
|||
Thank you. I now have a macro question though. Since I didn't know how to add a macro that is written, I recorded one, then edited it. After modifying my macro, the macro stopped working. So I opened 'Customized Quick Access Tool Bar' --> More Commands --> Macros --> then added that macro with a custom button.
From there it worked, but what should I have done to record and run this macro? |
#5
|
||||
|
||||
For PC macro installation & usage instructions, see: Installing Macros
For Mac macro installation & usage instructions, see: Word:mac - Install a Macro
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I change multiple pictures in Word 2016 to all new pictures that appear in a specified order? | chaz | Word VBA | 7 | 07-11-2018 03:57 AM |
Printer issue (and copy/paste): some pictures/text are not printed/showed | Jazz43 | Drawing and Graphics | 15 | 08-29-2016 04:17 AM |
copy a page or pages in word with inserted pictures. | datakop | Word | 2 | 04-03-2015 06:15 AM |
PowerPoint Macro - Copy and Replace pictures from one PPT to another PPT | mrayncrental | PowerPoint | 2 | 06-09-2014 02:52 AM |
Copy picture style to all pictures in a presentation | Gary Drumm | PowerPoint | 2 | 04-18-2013 10:36 AM |