Sub AdjustFormat() Dim doc As Document Set doc = ActiveDocument

'设置一级大纲格式
With doc.Styles(wdStyleOutline1)
    .Font.Name = "宋体"
    .Font.Size = 14
    .Font.Bold = True
    .ParagraphFormat.Alignment = wdAlignParagraphCenter
    .ParagraphFormat.LineSpacingRule = wdLineSpaceSingle
    .ParagraphFormat.SpaceBefore = 0
    .ParagraphFormat.SpaceAfter = 0
End With

'设置二级大纲格式
With doc.Styles(wdStyleOutline2)
    .Font.Name = "宋体"
    .Font.Size = 12
    .Font.Bold = True
    .ParagraphFormat.Alignment = wdAlignParagraphLeft
    .ParagraphFormat.LineSpacingRule = wdLineSpaceSingle
    .ParagraphFormat.SpaceBefore = 0
    .ParagraphFormat.SpaceAfter = 0
End With

'设置三级大纲格式
With doc.Styles(wdStyleOutline3)
    .Font.Name = "宋体"
    .Font.Size = 11
    .Font.Bold = False
    .ParagraphFormat.Alignment = wdAlignParagraphLeft
    .ParagraphFormat.LineSpacingRule = wdLineSpaceSingle
    .ParagraphFormat.SpaceBefore = 0
    .ParagraphFormat.SpaceAfter = 0
    .ParagraphFormat.FirstLineIndent = CentimetersToPoints(0.74)
End With

'设置四级大纲格式
With doc.Styles(wdStyleOutline4)
    .Font.Name = "宋体"
    .Font.Size = 11
    .Font.Bold = False
    .ParagraphFormat.Alignment = wdAlignParagraphLeft
    .ParagraphFormat.LineSpacingRule = wdLineSpaceSingle
    .ParagraphFormat.SpaceBefore = 0
    .ParagraphFormat.SpaceAfter = 0
    .ParagraphFormat.FirstLineIndent = CentimetersToPoints(0.74)
End With

End Su


原文地址: https://www.cveoy.top/t/topic/fYT5 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录