Sub SelectLevel1Heading() '选中一级标题 Dim rng As Range Set rng = ActiveDocument.Range rng.Select rng.Collapse wdCollapseStart rng.Find.ClearFormatting rng.Find.Style = ActiveDocument.Styles("Heading 1") rng.Find.Execute If rng.Find.Found = True Then rng.Expand wdParagraph rng.Select Else MsgBox "未找到一级标题" End If End Sub

帮我写一段VBA代码选中WORD中的一级标题

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

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