In this article, we want to share with you 2 quick ways to search for all underlined texts in your Word document.
A high occurrence of underlines in a Word document is not unusual. Therefore, so many demands relating to the applying of underlines keep coming up. Now let’s take a look at such requests.
- Find underlined spaces. You may feel at a loss at first thought. But, you can think in this way that when filling an exam in a Word document, you will need to search through the file to see whether there is a question left unanswered.
- Change a way to strike through texts. You can make texts stand out by underline them. However, there are also other means, like to apply texts with italic font style.
- Alter the color of underline. You can modify the underline color to make it more eye-catching.
In order to meet the above requirements, there is one shared step which is to search for underlines first. And here are our 2 methods:
Method 1: Use “Advanced Find” Option
- To start off, click “Home” tab.
- Then click on the upside-down triangle button behind the “Find”.
- Next choose “Advanced Find”.
- In the “Find and Replace” dialog box, click “Format” button.
- Then choose “Font”.
- In “Find Font” box, choose the underline style employed in your document and click “OK”.
- Now choose to either click “Find In” then the “Main Document” or keep clicking “Find Next”. The former will select all underlines in the document, while the latter will take you to step through underline one by one.
By the way, in case you want to skip step 4 to 6, you can use shortcuts. The “Ctrl+ U” refers to single underline and “Ctrl+ Shift+ D”, the double underline.
Method 2: Run the Word Macro
- At first, click “Developer” tab and then the “Visual Basic” to bring about the VBA editor. An alternative way is to press “Alt+ F11”.
- Next, click “Normal”.
- Then click “Insert” tab and choose “Module”.
- Now you have successfully inserted a new module under “Normal” project. Double click on the new module to open the editing area.
- Next paste the following codes there:
Sub FindUnderlineInDoc() Dim objDoc As Document Dim objRange As Range Set objDoc = ActiveDocument Set objRange = objDoc.Range objRange.Find.ClearFormatting objRange.Find.Font.Underline = wdUnderlineSingle With Selection.Find .text = "" .Forward = True .Wrap = wdFindContinue .Format = True .Execute End With End Sub
- Lastly, hit “Run” button.
Note:
Code line “objRange.Find.Font.Underline = wdUnderlineSingle” means this macro will find single underline. So to find underline with other styles, you need to replace the “wdUnderlineSingle” with other constants, which you can find more here: https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2003/aa224269(v=office.11)
Cope with Word Errors
While drafting your reports, have you ever encountered with a corrupt Word, thus losing the file you are just working on? Such scenario is the least we’d expect. Nevertheless, it does happen and can be a devastating blow to one’s career. Therefore, to save both your time and career, you’d need a professional too to repair your Word program.
Author Introduction:
Vera Chen is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including xls fix and pdf repair software products. For more information visit www.datanumen.com
Leave a Reply