全心思齐网

怎么样用word vba去掉页眉横线?

  如何使用word vba去掉页眉的横线实现代码下:

  Sub 页眉去线()

With ActiveDocument.Styles("页眉").ParagraphFormat

.Borders(wdBorderBottom).LineStyle = wdLineStyleNone

End With

End Sub

Sub 页眉去线2()

Dim asection As Section

For Each asection In ActiveDocument.Sections

With asection.Headers(wdHeaderFooterPrimary)

.Range.ParagraphFormat.Borders(wdBorderBottom).LineStyle = wdLineStyleNone

End With

Next

End Sub

Sub 页眉去线3()

Dim asection As Section

For Each asection In ActiveDocument.Sections

With asection.Headers(wdHeaderFooterPrimary)

.Range.ParagraphFormat.Style = "正文"

End With

Next

End Sub

匿名回答于2023-10-21 08:08:31


相关知识问答