从多个部分删除标题 [英] Delete Header from Multiple Sections

查看:139
本文介绍了从多个部分删除标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含多个部分的文档,许多部分都打开了不同的Frist页面。我需要能够从每个部分删除标题,包括第一页标题和主标题。 找不到合适的选项让我通过每个部分的
两个标题... 

I have a document with multiple Sections, many of the sections have Different Frist Page turned on. I need to be able to delete the header from every section including first page header and Primary Header.  Not finding the right option to get me through both headers in every section... 

推荐答案

试试这个:

Sub DeleteHeaders()
    Dim sec As Section
    Dim hdr As HeaderFooter
    For Each sec In ActiveDocument.Sections
        For Each hdr In sec.Headers
            If hdr.Exists Then
                If hdr.LinkToPrevious = False Or sec.Index = 1 Then
                    hdr.Range.Delete
                End If
            End If
        Next hdr
    Next sec
End Sub





这篇关于从多个部分删除标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆