by Allen Wyatt
(last updated June 8, 2019)
Trent works for a scientific publisher. In the manuscripts he works with there are many technical terms, such as names of various species of insects or animals. Scott has a need to make sure that all of these species names are italicized. Scott wonders if there is a way to use a list of terms (perhaps in a text file) and have Word make sure that each word in the list is shown in the document in italic.
There are multiple add-on tools you could get that would perform this particular task. Two of them suggested by WordTips readers include the following:
FRedit: http://www.archivepub.co.uk/book.html EditTools: http://www.wordsnsync.com/
These are powerful tools, and you can even get FRedit for free. The downside, of course, is that each tool comes with its own learning curve that you'll need to go through in order to get it to do what you want.
Another approach is to create your own macro to perform the task. Fortunately, such a macro would not be that complex. Basically, you could create a plain text file (using a program such as Notepad) that would contain a single species name on each line. Your macro could then open the file, read each line, and change all instances of that species to italic in your document.
Sub FindSpeciesForItalic2() Dim sSpecies As String Open "C:\species.txt" For Input As #1 Do While Not EOF(1) Line Input #1, sSpecies With Selection.Find .ClearFormatting .Replacement.ClearFormatting .Replacement.Font.Italic = True .Text = sSpecies .Forward = True .Wrap = wdFindContinue End With Selection.Find.Execute Replace:=wdReplaceAll Loop Close #1 End Sub
This macro relies on the text file named species.txt, stored in the root directory of the C: drive. (You can store it someplace else or name it something else, but in that case, you would need to change the line of code to reflect the changes.) After each line is read from the text file, Find and Replace is used to make sure that the text is changed to italic.
It typically wouldn't be a problem with species names, but you'll want to make sure that each line in the text file is unique enough that you don't get partial words affected in the document. For instance, it wouldn't be a good idea to do a search for just "one" because that would match things like "done" or "tone" or "loner" or... Well, you get the idea.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13639) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Office 365.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
Want to copy a format from one place to another without taking your hands off the keyboard? It's easy to do if you apply ...Discover More
Justifying a paragraph may have undesired effects on the last line of a paragraph. If this occurs with your text, you'll ...Discover More
Formal reports look better when they are set up with an introductory cover page. Here's how you can add a cover page in a ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.