今天介绍下 Aspose.Words 对 word 中的图片进行删除
string tempFile = Application.StartupPath + "\\resource\\templete\\项目建议书模板.doc";
Document doc = new Document(tempFile); NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true);
foreach (Shape item in shapes)
{
if (item.HasImage)
{
item.Remove();
}
}
doc.Save(docPath);