本帖最后由 13907933959 于 2016-8-3 17:07 编辑
师傅好! 另外、师傅模板里的这个代码不知什么原因,运行不了。运行后,弹出提示框,“编译错误,子过程或函数未定义”。再查看代码窗口,该句 TitleExtend 代码为选中状态。
Sub 短标题() Dim i As Paragraph For Each i In ActiveDocument.Paragraphs If Not (i.Range Like "*[。:;,、!?”…—.:;,!?]" & vbCr) Then With i.Range .Style =ActiveDocument.Styles(wdStyleSubtitle) .Font.Name = "黑体" .Font.Name = "Times NewRoman" With .ParagraphFormat .LineUnitBefore = 2 .LineUnitAfter = 1.5 .AutoAdjustRightIndent =False .DisableLineHeightGrid =True End With .Select TitleExtend End With End If Next End Sub
|