Thanks for your inquiry. You can do it using DocumentVisitor. Please try using the following code:

// Open document.
Document doc = new Document("C:\\Temp\\test2.docx"); ChangeHighlightColor changeHighlightColor = new ChangeHighlightColor(Color.Transparent); doc.Accept(changeHighlightColor); doc.Save("C:\\Temp\\out.docx"); class ChangeHighlightColor : DocumentVisitor
{
public ChangeHighlightColor(System.Drawing.Color highlighColor)
{
mHighlighColor = highlighColor;
} /// <summary>
/// Called when a FieldEnd node is encountered in the document.
/// </summary>
public override VisitorAction VisitFieldEnd(Aspose.Words.Fields.FieldEnd fieldEnd)
{
//Simply change font name
ChangeFont(fieldEnd.Font);
return VisitorAction.Continue;
} /// <summary>
/// Called when a FieldSeparator node is encountered in the document.
/// </summary>
public override VisitorAction VisitFieldSeparator(Aspose.Words.Fields.FieldSeparator fieldSeparator)
{
ChangeFont(fieldSeparator.Font);
return VisitorAction.Continue;
} /// <summary>
/// Called when a FieldStart node is encountered in the document.
/// </summary>
public override VisitorAction VisitFieldStart(Aspose.Words.Fields.FieldStart fieldStart)
{
ChangeFont(fieldStart.Font);
return VisitorAction.Continue;
} /// <summary>
/// Called when a Footnote end is encountered in the document.
/// </summary>
public override VisitorAction VisitFootnoteEnd(Footnote footnote)
{
ChangeFont(footnote.Font);
return VisitorAction.Continue;
} /// <summary>
/// Called when a FormField node is encountered in the document.
/// </summary>
public override VisitorAction VisitFormField(Aspose.Words.Fields.FormField formField)
{
ChangeFont(formField.Font);
return VisitorAction.Continue;
} /// <summary>
/// Called when a Paragraph end is encountered in the document.
/// </summary>
public override VisitorAction VisitParagraphEnd(Paragraph paragraph)
{
ChangeFont(paragraph.ParagraphBreakFont);
return VisitorAction.Continue;
} /// <summary>
/// Called when a Run node is encountered in the document.
/// </summary>
public override VisitorAction VisitRun(Run run)
{
ChangeFont(run.Font);
return VisitorAction.Continue;
} /// <summary>
/// Called when a SpecialChar is encountered in the document.
/// </summary>
public override VisitorAction VisitSpecialChar(SpecialChar specialChar)
{
ChangeFont(specialChar.Font);
return VisitorAction.Continue;
} private void ChangeFont(Font font)
{
font.HighlightColor = mHighlighColor;
}
private System.Drawing.Color mHighlighColor = System.Drawing.Color.Transparent;
} Best regards,

Remove highlight from document(Aspose Word 删除高亮)的更多相关文章

  1. Aspose Word.Dll库自带的bug导致The document appears to be corrupted and cannot be loaded 问题处理。

    问题的详细描述: C#在开发过程中使用Aspose.word.dll库去实现word套打功能.但是,最近客户反映出现了一个问题,在打印文档的时候,系统报错.经过定位分析发现是Aspose.word.d ...

  2. 利用Aspose.Word控件和Aspose.Cell控件,实现Word文档和Excel文档的模板化导出

    我们知道,一般都导出的Word文档或者Excel文档,基本上分为两类,一类是动态生成全部文档的内容方式,一种是基于固定模板化的内容输出,后者在很多场合用的比较多,这也是企业报表规范化的一个体现. 我的 ...

  3. Aspose Word模板使用总结

    Aspose Word模板使用总结 1.创建word模版,使用MergeFeild绑定数据     新建一个Word文档,命名为Template.doc     注意:这里并不是输入"< ...

  4. 利用Aspose.Word控件实现Word文档的操作

    Aspose系列的控件,功能都挺好,之前一直在我的Winform开发框架中用Aspose.Cell来做报表输出,可以实现多样化的报表设计及输出,由于一般输出的内容比较正规化或者多数是表格居多,所以一般 ...

  5. 黄聪:利用Aspose.Word控件实现Word文档的操作(转)

    撰写人:伍华聪  http://www.iqidi.com  Aspose系列的控件,功能都挺好,之前一直在我的Winform开发框架中用Aspose.Cell来做报表输出,可以实现多样化的报表设计及 ...

  6. Aspose.Word邮件合并之自定义数据源

    Aspose.Word在进行邮件合并时,默认的几个重载方法对Database支持比较友好,但是也可以通过自定义数据源来实现从集合或者对象中返回数据进行邮件合并. 自定义数据源主要是通过实现IMailM ...

  7. aspose.word 使用简单方法

    aspose.word使用简单方法 概念介绍 使用aspose生成word报表步骤: 加载word模板 提供数据源 填充 加载模板 提供了4种重载方法 1 2 3 4 5 public Documen ...

  8. Word 代码高亮

    整理文档比较费事,提供个脚本放在VBA里,使Word 代码高亮的一种方法是改变颜色 'script to high light code In document Private Function is ...

  9. aspose.word 读取word段落内容

    注:转载请标明文章原始出处及作者信息 aspose.word 插件下载 链接: http://pan.baidu.com/s/1qXIgOXY 密码: wsj2 使用原因:无需安装office,无兼容 ...

随机推荐

  1. MAC上更新Ruby失败解决办法

    尝试用RVM升级Ruby http://blog.csdn.net/lissdy/article/details/9191351 如果碰到下面问题 Searching for binary rubie ...

  2. Java泛型方法定义及泛型类型推断

    泛型的推断 @Test public void test3(){ //类型推断时使用两个类型的最小公倍数 int x1 = add(3,4); Number x2 = add(3.5,4); Obje ...

  3. android自定义控件之模仿优酷菜单

    去年的优酷HD版有过这样一种菜单,如下图: 应用打开之后,先是三个弧形的三级菜单,点击实体键menu之后,这三个菜单依次旋转退出,再点击实体键menu之后,一级菜单会旋转进入,点击一级菜单,二级菜单旋 ...

  4. .NET生成PDF文件

    C#未借助第三方组件,自己封装通用类,生成PDF文件. 调用方式: //路径 string path = @"C:\yuannwu22.pdf"; //内容 string strC ...

  5. Hello World深入理解

    每个编程人员都知道第一个都是Hello World, 可是只是单知道 用,不知道为何会这样,就一直学的只是皮毛. 学东西,不能知其然而不知其所以然.这样永远达不到境界. 我们用编辑器eclipse 创 ...

  6. [访问系统] Api_Win32_Mac类工具包 (转载)

    点击下载 Api_Win32_Mac.zip using System; using System.Collections.Generic; using System.Linq; using Syst ...

  7. 使用dojo遮罩加载进度。

    使用dojox.widget.Standby来实现类似视频缓冲加载时候转圈的效果.

  8. yieId浅谈

    例子:在不使用yieId时,通常我们都会采取先遍历再把元素加到新的List中 using (var reader = SqlHelper.ExecuteReader("")) { ...

  9. 收集统计信息让SQL走正确的执行计划

    数据库环境:SQL SERVER 2005 今天在生产库里抓到一条跑得慢的SQL,语句不是很复杂,返回的数据才有800多行, 却执行了34分钟,甚至更久. 先看一下执行结果 我贴一下SQL. SELE ...

  10. Oracle学习【索引及触发器】

    索引B_Tree结构 请参照 响应图例 索引是一种允许直接访问数据表中某一数据行的树形结构,为了提高查询效率而引入,是独立于表的对象,可以存放在与表不同的表空间中.索引记录中存有索引关键字和指向表中数 ...