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.

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


2

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:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

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.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Inserting Custom Properties with Fields

If you define a group of custom properties for a document, you may want a way to display the contents of those properties ...

Discover More

Segregating Numbers According to Their Sign

Remember your number line from your early years in school? Some numbers can be below zero (negative numbers) and others ...

Discover More

Printing A4 on Letter Size Paper

For those around the world using the metric system, the standard size for many documents is referred to as an A4 page. If ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More WordTips (ribbon)

Using Message Boxes

If your macro needs to communicate with a user, one simple way to do it is to use a message box. Here's how to use this ...

Discover More

Editing Word's Built-in Commands

Want to configure Word to do just what you want it to? You can even go so far as to change the actual way in which Word ...

Discover More

Determining the Month of the Year

Your macro code may need to determine the month of the year represented by a particular date. You can find the desired ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven more than 1?

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

Evan FitzGerald

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.


This Site

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.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.