Home

A Double-Indent Paragraph Macro for Word 2016

|
Updated:  
2016-11-16 3:44:45
|
Word 2010 For Dummies
Explore Book
Buy On Amazon
A double-indent paragraph macro in Word 2016 modifies a paragraph's indentation, increasing both left and right attributes by half an inch. This effect could be applied by using a style, but a style sets the indentations to a specific value. When the macro is run, no matter what the current indentations are, the new values are a half-inch greater.

Here is the code for the double_indent macro:

Sub double_indent() ' ' double_indent Macro ' add half inch to both sides of the current paragraph ' pleft = Selection.ParagraphFormat.LeftIndent + InchesToPoints(0.5) pright = Selection.ParagraphFormat.RightIndent + InchesToPoints(0.5)

With Selection.ParagraphFormat

.LeftIndent = pleft

.RightIndent = pright End With

End Sub

The macro takes the current paragraph indent values and adds a half-inch to each. These values are saved in the pleft and pright variables. The current paragraph's format is then modified, reset to those values.

  • This macro cannot be faked with recorded keystrokes. You must code it directly.
  • The Ctrl+M keyboard shortcut works similarly to the double_indent macro, but it affects only the paragraph's left indent value.

About This Article

This article is from the book: 

About the book author:

Dan Gookin has been writing about technology for 20 years. He has contributed articles to numerous high-tech magazines and written more than 90 books about personal computing technology, many of them accurate.
He combines his love of writing with his interest in technology to create books that are informative and entertaining, but not boring. Having sold more than 14 million titles translated into more than 30 languages, Dan can attest that his method of crafting computer tomes does seem to work.
Perhaps Dan’s most famous title is the original DOS For Dummies, published in 1991. It became the world’s fastest-selling computer book, at one time moving more copies per week than the New York Times number-one best seller (although, because it’s a reference book, it could not be listed on the NYT best seller list). That book spawned the entire line of For Dummies books, which remains a publishing phenomenon to this day.
Dan’s most recent titles include PCs For Dummies, 9th Edition; Buying a Computer For Dummies, 2005 Edition; Troubleshooting Your PC For Dummies; Dan Gookin’s Naked Windows XP; and Dan Gookin’s Naked Office. He publishes a free weekly computer newsletter, “Weekly Wambooli Salad,” and also maintains the vast and helpful Web site www.wambooli.com.