Word 2016的双缩进段落宏?

来源:互联网 时间:2026-02-26 12:09:42 作者:

Word 2016的双缩进段落宏?Word 2016中的双缩进段落宏会修改段落的缩进,将左右属性都增加半英寸。可以通过使用样式来应用此效果,但是样式可以将缩进设置为特定值。运行宏时,无论当前缩进是什么,新值都将增加半英寸。

这是double_indent宏的代码:

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

该宏采用当前段落的缩进值,并为每个缩进一半。这些值保存在pleftpright变量中。然后修改当前段落的格式,将其重置为这些值。

录制的击键不能伪造此宏。您必须直接对其进行编码。Ctrl + M键盘快捷键的工作方式与double_indent宏相似,但它仅影响段落的左缩进值。

相关推荐