In today’s post, we are happy to share 2 quick methods with you to extract texts of the same color from your Word document.
Now and then, while formatting on a Word document, we are likely to apply font color for some texts so as to strike them out for extra attention. Usually, these colored words are important contents that deserve your review again. Then how about exporting and collecting them to somewhere else for a clear check later?
With focus on this demand, we suggest you 2 speedy shortcuts instead of endless cutting and pasting actions.
Method 1: Utilize the “Find” Feature
- First off, click “Home” tab.
- Then go to “Editing” group to click the upside down triangle button next to “Find”.
- Next choose “Advanced Find” on the list.
- In “Find and Replace” dialog box, put cursor in “Find what” text box and clear any content there if any.
- Next click “More” button.
- Now click “Format” button and Choose “Font”.
- In “Find Font” dialog box, click the drop down button behind “Font color” to choose the exact color you assign to your texts.
- Remember to click “OK”.
- Now back to the “Find and Replace” box and click “Find In”.
- Finally, choose “Main Document”.
Then all texts in the target color will be selected. You now can press “Ctrl+ C” to copy and then paste them on another location with one go.
Method 2: Run a Word Macro
- First and foremost, click “Developer” tab.
- Then click “Visual Basic” to trigger the VBA editor.
- Next click “Normal” and then “Insert”.
- Choose “Module” on the menu.
- Then double click on the module to activate the coding space.
- Next paste codes:
Sub ExtractColoredTexts() Dim objDoc As Document, objDocAdd As Document Dim objRange As Range Set objDoc = ActiveDocument Set objDocAdd = Documents.Add objDoc.Activate With Selection .HomeKey Unit:=wdStory With Selection.Find .ClearFormatting .Replacement.ClearFormatting .Font.Color = wdColorRed .Text = "" .Execute End With Do While .Find.Found Set objRange = Selection.Range objDocAdd.Range.InsertAfter objRange & vbCr .Collapse wdCollapseEnd .Find.Execute Loop End With End Sub
- Now click “Run” button.
There shall be a new document open with all the extracted texts.
Note: In code line “.Font.Color = wdColorRed”, you need to replace “wdColorRed” with the actual color of your texts. For detailed reference, you can visit this page: https://docs.microsoft.com/en-us/office/vba/api/Word.WdColor
Address Word Problem
Most of us are already a frequent user of Word. Yet, despite of it, we can still encounter with some tough problems, such as the collapse of Word. This is by all means a quite serious one, for your critical files can be on the line. Under such circumstances, it’s suggested to obtain a Word data error repair tool which shall recover Word data in only a few minutes.
Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including xls data problem repair tool and pdf repair software products. For more information visit www.datanumen.com