Sub ChangeLevel3ToNormal() Dim doc As Document Dim sec As Section Dim hdr As HeaderFooter Dim rng As Range Dim i As Integer

Set doc = ActiveDocument

For Each sec In doc.Sections
    For Each hdr In sec.Headers
        For i = 1 To hdr.Range.Paragraphs.Count
            Set rng = hdr.Range.Paragraphs(i).Range
            If rng.Style = 'Heading 3' Then
                rng.Style = 'Normal'
            End If
        Next i
    Next hdr
Next sec

For i = 1 To doc.Content.Paragraphs.Count
    Set rng = doc.Content.Paragraphs(i).Range
    If rng.Style = 'Heading 3' Then
        rng.Style = 'Normal'
    End If
Next i

End Sub

VBA 代码:将 Word 中的 3 级标题转换为正文文本

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

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