|
有些时候这些东西很烦人,去掉吧,增加打印面积。在word2003中测试通过!
Sub 删除页眉页脚()
On Error Resume Next
Application.ScreenUpdating = False
With ActiveDocument
.ActiveWindow.View.Type = wdPrintView
For Each oSec In mydoc.Sections '文档的节中循环
For i = 9 To 10
.ActiveWindow.View.SeekView = i '9-wdSeekCurrentPageHeader,10-wdSeekCurrentPageFooter
.Application.Selection.WholeStory
.Application.Selection.Delete
.ActiveWindow.View.SeekView = 0 ' wdSeekMainDocument
Next
Next
End With
Application.ScreenUpdating = True
MsgBox "恭喜你,删除完毕!"
End Sub
[ 本帖最后由 chinablank 于 2011-5-8 22:53 编辑 ] |
|