跳到主要内容

移除页眉页脚 ExcelPower Automate

PDF4me 移除页眉页脚 Excel 是一个 Power Automate 此操作可在重新命名或归档工作簿之前,从中移除选定的页眉和页脚部分。您可以使用它来清除特定工作表或整个文件中左侧、中间或右侧区域的旧徽标、季度标签或机密标记。

此操作的作用

PDF4me 移除页眉页脚 Excel 清除现有工作簿中六个独立区域中的任意一个:左侧页眉、居中页眉、右侧页眉、左侧页脚、居中页脚和右侧页脚。您可以按名称或索引指定特定工作表,也可以将名称和索引都留空,以便一次性清除所有工作表。

相关博客文章
目前尚无关于此功能的博客文章——敬请期待。
在此期间,您可以浏览 PDF4me 博客,查看适用于各平台的教程和工作流程。
访问博客

我如何验证我的身份 Power Automate 流动?

每一个 PDF4me 行动 Power Automate 需要有效的连接。创建或选择一个包含您数据的连接。 PDF4me API 关键在于流程能够进行身份验证 Excel 安全地请求页眉/页脚。

您不容错过的重要事实

六个独立的“是/否”区域
“移除左侧、中间、右侧页眉”和“移除左侧、中间、右侧页脚”分别是单独的“是/否”下拉菜单,默认值为“否”。仅设置要清除的区域。
工作表定位的 3 个高级参数
“高级参数”面板显示“显示 1/3”:工作表名称、工作表索引和区域性名称。将工作表名称和工作表索引留空,即可处理工作簿中的每个工作表。
仅需提供文件内容。
连接器面板会用星号标记必填的文件内容。文件名和所有删除标志均为可选。如果所有标志都设置为“否”,则运行将成功完成,但返回的工作簿将保持不变。
Power Automate PDF4me 的“移除页眉页脚”操作已配置,文件内容已映射,文件名已添加为 add_header_sample_file.xlsx,“移除左侧页眉”设置为“是”,“移除居中页眉”、“移除右侧页眉”、“移除左侧页脚”、“移除居中页脚”和“移除右侧页脚”均设置为“否”,高级参数显示“1/3”,且“区域性名称”可见。

映射文件内容,设置文件名,然后仅将要删除的页眉/页脚区域切换为“是”。

参数

必需的: 只需提供文件内容。文件名和所有六个删除标志均为可选。工作表名称、工作表索引和区域性名称是条件性高级参数,仅当您需要超出默认值的目标定位或本地化时才需要。

范围必需的它的作用例子
File ContentRequiredBase64 content of the source Excel workbook, mapped from SharePoint, OneDrive, or another prior action.[File Content from Get file content]
File NameOptionalExcel filename including extension (.xlsx or .xls), used for processing and output identification.add_header_sample_file.xlsx
Remove Header LeftOptionalYes clears the left section of the header, No preserves it. Defaults to No.Yes
Remove Header CenterOptionalYes clears the center section of the header, No preserves it. Defaults to No.No
Remove Header RightOptionalYes clears the right section of the header, No preserves it. Defaults to No.No
Remove Footer LeftOptionalYes clears the left section of the footer, No preserves it. Defaults to No.No
Remove Footer CenterOptionalYes clears the center section of the footer, No preserves it. Defaults to No.No
Remove Footer RightOptionalYes clears the right section of the footer, No preserves it. Defaults to No.No
Worksheet NamesConditionalAdvanced parameter. List of worksheet names to target, for example Sheet1 or Report. Leave empty along with Worksheet Indexes to process every sheet.["Sheet1", "Report"]
Worksheet IndexesConditionalAdvanced parameter. List of 0-based worksheet indexes to target. Combines with Worksheet Names if both are set.[0, 2]
Culture NameConditionalAdvanced parameter. Culture/locale code for processing, for example en-US or de-DE. Blank uses the invariant culture.en-US

输出字段

场地类型它包含什么
documentBase64The Excel workbook with the selected header/footer sections removed.
SuccessBooleantrue if the action completed, false if it failed.
ErrorMessageStringError description, null when Success is true.
ErrorsArrayDetailed error objects, empty when Success is true.

常见错误信息是什么意思?

错误信息原因解决方案
Request is emptyThe request object is null.Provide a valid request object.
Document is emptyFile Content is null or empty.Provide a valid Excel document in File Content.
Invalid worksheet selectionWorksheet names don't exist or indexes are out of range.Use existing worksheet names or valid 0-based indexes.
Available worksheets in workbook (X total)Informational message shown when worksheet selection fails.Review worksheet names/indexes and use a valid value from the X available worksheets.

如何设置移除页眉页脚? Power Automate

  1. 添加 PDF4meExcel - 删除页眉页脚 致你 Power Automate 流动。
  2. 地图 文件内容 来自之前的操作(SharePointOneDrive(或获取文件内容)并设置 文件名
  3. 移除左侧标题移除标题中心, 或者 移除右侧标题是的 对于要清除的每个标头区域。
  4. 移除左侧页脚移除页脚中心, 或者 移除页脚右侧是的 针对您想要清除的每个页脚区域。
  5. 扩张 高级参数 针对特定目标 工作表名称 或者 工作表索引或者将两者都留空以处理每个工作表。运行流程后,清理后的工作簿将返回。 文档

典型配置

工作流程示例Common Power Automate flow patterns using Remove Header Footer.
品牌重塑准备工作
  1. 品牌重塑计划流程由以下因素触发: SharePoint 模板库。
  2. 获取文件内容检索每个 Excel 模板。
  3. 删除页眉页脚会将所有六个删除标志设置为“是”,并将工作表名称和工作表索引留空,以清除每个工作表。
  4. 添加文本页眉页脚功能会将新的品牌标识添加到清理后的工作簿中。
季度模板清理
  1. 每个季度初都会运行一个预定流程。
  2. 获取文件内容,检索季度报告模板。
  3. 删除页眉页脚设置“删除页眉居中”和“删除页脚左侧”为“是”,“删除页眉右侧”保持为“否”以保留页码,目标工作表名称为“摘要”、“财务数据”。
  4. 后续操作会将新的季度标签插入到已清除的标题中。
客户交付物消毒
  1. 当内部报告被标记为交付给客户时,流程就会触发。
  2. 获取文件内容会检索内部 Excel 报告。
  3. 移除页眉页脚会将所有页脚标志设置为“是”,并将“移除左侧页眉”、“移除居中页眉”设置为“是”,同时将“移除右侧页眉”设置为“否”以保留分页,主要部分使用工作表索引 [0, 1, 2]。
  4. 经过清理的工作簿将通过电子邮件发送给客户相关人员。

实用技巧

Each zone is independent
You do not need to clear all six zones. Set only the specific Header/Footer Left, Center, or Right flags to Yes for the sections you actually want removed.
Empty worksheet selectors mean all sheets
If both Worksheet Names and Worksheet Indexes are left empty, the action processes every worksheet in the workbook, not just the first one.
Worksheet Names and Indexes combine, not replace
If you set values in both Worksheet Names and Worksheet Indexes, the action processes the union of both lists, so a name typo will not silently exclude a sheet if its index is also listed.
This does not touch worksheet data
Only the header and footer margins are affected. Cell values, formulas, and body formatting are left exactly as they were.
Branch on Success before continuing
Add a Condition on Success after this action so a failed run does not pass a partially cleaned workbook further down the flow.

速查表

场地价值
ActionExcel - Remove Header Footer
Required fieldsFile Content
Header removal flagsRemove Header Left, Center, Right (each Yes/No, default No)
Footer removal flagsRemove Footer Left, Center, Right (each Yes/No, default No)
Advanced parameters3 total: Worksheet Names, Worksheet Indexes, Culture Name
Outputdocument (Base64 workbook) + Success + ErrorMessage + Errors

常见问题

How do I remove headers and footers from an Excel file in Power Automate?+
Add the PDF4me Remove Header Footer action, map the workbook into File Content, then set Remove Header Left, Center, Right and Remove Footer Left, Center, Right to Yes for each section you want stripped. Sections left at No are preserved.
Can I remove headers from only some worksheets, not the whole workbook?+
Yes. Expand Advanced parameters and list Worksheet Names or Worksheet Indexes for the sheets to target. Leaving both empty processes every worksheet in the workbook. See Microsoft's guide to <a href="https://support.microsoft.com/en-us/office/headers-and-footers-in-a-worksheet-a4a1e099-8ee5-4f30-be8f-c8ba201e7005" target="_blank" rel="noopener noreferrer">headers and footers in a worksheet</a> for how Excel organizes header/footer scope per sheet.
Can I remove just the center header and keep the left and right sections?+
Yes. Each of the six sections, Header Left, Header Center, Header Right, Footer Left, Footer Center, Footer Right, is an independent Yes/No dropdown, so you can strip one section while leaving the other five untouched.
What is Culture Name used for in this action?+
Culture Name is an optional advanced parameter that sets the locale used during processing, for example en-US or de-DE. Leave it blank to use the invariant culture. See <a href="https://www.ablebits.com/office-addins-blog/excel-header-footer-add-change-remove/" target="_blank" rel="noopener noreferrer">Ablebits' guide to Excel headers and footers</a> for how locale affects header/footer formatting codes.
Does removing headers and footers change the worksheet data?+
No. The action only clears the selected header and footer sections. Cell data, formulas, and formatting in the worksheet body are left untouched.

行业应用案例及应用

  • 公司品牌重塑从所有 Excel 模板中删除旧的公司徽标和名称
  • 并购整合在应用合并实体品牌标识之前,请清理页眉/页脚。
  • 部门重组从部门模板中移除旧的部门标题
  • 产品线变更:从销售和营销模板中获取清晰的产品品牌信息

相关操作

在其他平台上执行相同任务

获取帮助