|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
* 相见,我将 10 楼代码加上了《删除制表符》代码,请试试:(你所见的横线并不在页眉中而在正文中)
- Sub aaaa删除页眉里面的文本框1103()
- Dim oDoc As Document
- Set oDoc = Word.ActiveDocument
- Dim oSec As Section
- With oDoc
- '先遍历所有的节对象
- For Each oSec In .Sections
- With oSec
- With .Headers(wdHeaderFooterPrimary)
- .Range.Delete
- End With
- With .Headers(wdHeaderFooterEvenPages)
- .Range.Delete
- End With
- .Headers(wdHeaderFooterPrimary).Range.ParagraphFormat.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
- .Headers(wdHeaderFooterEvenPages).Range.ParagraphFormat.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
- End With
- Next
- End With
- '删除页眉横线
- ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
- Selection.ParagraphFormat.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
- ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
- '删除制表符
- ActiveDocument.Content.Find.Execute "^t", , , 0, , , , , , "", 2
- End Sub
复制代码 |
|