以下宏代碼,,自動(dòng)清除Word當(dāng)中的全部的文本框,、圖文框,,在Word 2003當(dāng)中測試通過: Sub 刪除全部文本框() ' ' 刪除全部文本框,,保留文字 ' Dim i As Shape For Each i In ActiveDocument.Shapes i.ConvertToFrame Next Dim ii As Frame For Each ii In ActiveDocument.Frames ii.Delete Next ' 取消所有框線 ' ------------注:若文章當(dāng)中存在有用的框線,,請(qǐng)刪除下邊這幾句--------- Selection.WholeStory With Selection.ParagraphFormat .Borders(wdBorderLeft).LineStyle = wdLineStyleNone .Borders(wdBorderRight).LineStyle = wdLineStyleNone .Borders(wdBorderTop).LineStyle = wdLineStyleNone .Borders(wdBorderBottom).LineStyle = wdLineStyleNone .Borders(wdBorderHorizontal).LineStyle = wdLineStyleNone End With ' ------------注:若文章當(dāng)中存在有用的框線,,請(qǐng)不要執(zhí)行上邊這幾句--------- End Sub 使用方法: 在Word中按“Alt+F11”,將上邊的那一大段宏復(fù)制/粘貼進(jìn)去,,保存即可,。 執(zhí)行則按“Alt+F8”,選擇“刪除全部文本框”,,點(diǎn)“執(zhí)行” |
|