Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Controlling the Italic Text Attribute.
Written by Allen Wyatt (last updated July 5, 2022)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365
Word allows a rich set of formatting attributes for text in a document. You can control the italic attribute in your macros by setting the value of the italic property. The syntax if you are using VBA is as follows:
Selection.Font.Italic = toggle
where toggle is either False (turns off the italic attribute) or True (turns on the italic attribute).
If you omit a toggle value, the statement will simply change the current setting of the italic attribute—italic text becomes non-italic and vice-versa.
Note:
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12501) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Controlling the Italic Text Attribute.
The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!
Formulas created in a macro have a specific order in which operations are performed. This is known as precedence, as ...
Discover MoreAn elegant way to run macros from within macros is to use the Call statement. In order to use it, you need to provide a ...
Discover MoreIn some documents Roman numerals might be used quite a bit. If you ever want to change the Roman numerals to their Arabic ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2020-08-24 09:42:56
Andrew
Even, a couple of thoughts:
The simplest way is to sprinkle "MsgBox [text]" commands in your code where needed--this will both display text and pause the macro.
A second way to display text without interrupting the macro is using "debug.print [text]" which will "print" the text to the immediate window. And you can pause the macro by adding breakpoints to specific lines in your code in the debugger.
andy.
2020-08-23 20:19:59
I wish to activate WriteLine() without actually printing to the document. I am finding this almost impossible! Word does not recognize this command.
Also I wish to PAUSE macros that have a step-by-step procedure that I wish to see execute. WAIT and PAUSE do not seem to be recognizable to VB/or am I wrong????
Please, help me if you can?
evan be fitzGeralD.
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.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments