公文标题排版(样式修改)

公文标题的排版,先设置一个样式,我选择将word内置的“标题”样式进行修改。代码如下:

Sub 标题一()
    '标题一:黑体 三号字
    With ActiveDocument.Styles("标题").Font
        .NameFarEast = "黑体"
        '西文字体
             .NameAscii = "Times New Roman"
        .NameOther = "Times New Roman"
        .Name = "Times New Roman"
        .Size = 16
    End With
    With ActiveDocument.Styles("标题").ParagraphFormat
        .LeftIndent = CentimetersToPoints(0)
        .RightIndent = CentimetersToPoints(0)
        .LineSpacingRule = wdLineSpaceExactly
        .LineSpacing = 28.8
        .CharacterUnitFirstLineIndent = 2
        .CharacterUnitRightIndent = 0
        .AutoAdjustRightIndent = True
     .Alignment = wdAlignParagraphLeft '左对齐
     '段前短后0磅
             .SpaceBefore = 0
        .SpaceBeforeAuto = False
        .SpaceAfter = 0
        .SpaceAfterAuto = False
    End With
    ActiveDocument.Styles("标题").NoSpaceBetweenParagraphsOfSameStyle = False
    With ActiveDocument.Styles("标题")
        .AutomaticallyUpdate = False
        .BaseStyle = "正文"
        .NextParagraphStyle = "标题"
    End With
End Sub
    
    Sub 标题二()
        '标题二:楷体三号字
        With ActiveDocument.Styles("标题").Font
            .NameFarEast = "楷体"
                 .NameAscii = "Times New Roman"
        .NameOther = "Times New Roman"
        .Name = "Times New Roman"
            .Size = 16
        End With
        With ActiveDocument.Styles("标题").ParagraphFormat
           .LeftIndent = CentimetersToPoints(0)
        .RightIndent = CentimetersToPoints(0)
        .LineSpacingRule = wdLineSpaceExactly
        .LineSpacing = 28.8
        .CharacterUnitFirstLineIndent = 2
        .CharacterUnitRightIndent = 0
        .AutoAdjustRightIndent = True
        .Alignment = wdAlignParagraphLeft '左对齐
     '段前短后0磅
             .SpaceBefore = 0
        .SpaceBeforeAuto = False
        .SpaceAfter = 0
        .SpaceAfterAuto = False
        End With
        ActiveDocument.Styles("标题").NoSpaceBetweenParagraphsOfSameStyle = False
        With ActiveDocument.Styles("标题")
            .AutomaticallyUpdate = False
            .BaseStyle = "正文"
            .NextParagraphStyle = "标题"
        End With
    End Sub
Sub 标题三()
    '标题三:仿宋三号
    With ActiveDocument.Styles("标题").Font
        .NameFarEast = "仿宋_GB2312"
             .NameAscii = "Times New Roman"
        .NameOther = "Times New Roman"
        .Name = "Times New Roman"
        .Size = 16
    End With
    With ActiveDocument.Styles("标题").ParagraphFormat
        .LeftIndent = CentimetersToPoints(0)
        .RightIndent = CentimetersToPoints(0)
        .LineSpacingRule = wdLineSpaceExactly
        .LineSpacing = 28.8
        .CharacterUnitFirstLineIndent = 2
        .CharacterUnitRightIndent = 0
        .AutoAdjustRightIndent = True
        .Alignment = wdAlignParagraphLeft '左对齐
     '段前短后0磅
             .SpaceBefore = 0
        .SpaceBeforeAuto = False
        .SpaceAfter = 0
        .SpaceAfterAuto = False
    End With
    ActiveDocument.Styles("标题").NoSpaceBetweenParagraphsOfSameStyle = False
    With ActiveDocument.Styles("标题")
        .AutomaticallyUpdate = False
        .BaseStyle = "正文"
        .NextParagraphStyle = "标题"
    End With
End Sub
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值