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.