Subido por Rosa

Eliminar encabezados y pies de página en Word (VBA)

Anuncio
Sub RemoveHeadAndFoot()
'Elimina todos los encabezados y pies del documento
Dim oSec As Section
Dim oHead As HeaderFooter
Dim oFoot As HeaderFooter
For Each oSec In ActiveDocument.Sections
For Each oHead In oSec.Headers
If oHead.Exists Then oHead.Range.Delete
Next oHead
For Each oFoot In oSec.Footers
If oFoot.Exists Then oFoot.Range.Delete
Next oFoot
Next oSec
Selection.WholeStory
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.ParagraphFormat.Borders(wdBorderBottom).LineStyle =
wdLineStyleNone
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub
Descargar