删除水印一般使用的是直接进入页眉视图,然后删除代码如下:
_appWord.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekCurrentPageHeader;
_appWord.Selection.HeaderFooter.Shapes["PowerPlusWaterMarkObject53265"].Select();
_appWord.Selection.Delete();
_appWord.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekMainDocument;
这种方式进行批量删除如果文档中无水印则必然报错,所以使用更加安全方法如下:
_appWord.WordBasic.RemoveWatermark();
一行代码搞定,安全而且无需任何判断即可删除水印