
word
vbSub DeleteContinuousSectionBreaks()Dim section As SectionFor Each section In ActiveDocument.SectionsIf section.PageSetup.SectionStart = wdSectionContinuous Thensection.Range.Characters.Last.DeleteEnd IfNextEnd Sub这个代码会遍历文档中的所有段落格式,如果当前段落格式的起始段落样式为连续分节符,则会删除最后一个字符。这样就能一次性删除所有连续分节符。请注意,这段代码只适用于word文档。在其他类型的文档中,可能会有不同的方式来删除连续分节符。Copyright © 2025 IZhiDa.com All Rights Reserved.
知答 版权所有 粤ICP备2023042255号