如何使用c#突出显示word文档中的非标准字体

问题描述:

我希望使用c#

在word 2007文档中突出显示非标准字体的字符。这个问题毫无意义,对不起。突出显示(或者您的意思是选择?)是文档中流的范围,而不是字体。 字体在这里完全不相关。选择不是文档的一部分;它是用户与文档工作会话的一部分;这是无关紧要的,除非你做自动化(为什么?)。然后突出显示需要澄清。



无论你做什么,你都可以使用Office互操作程序集或Open XML SDK。请参阅此答案中引用的过去的答案:如何从MS Visual中添加参考添加microsoft excel 15.0对象库Studio 2010 [ ^ ] 。



-SA
The question makes no sense, sorry. Highlighted (or do you mean selected?) is the range of the flow in the document, not font. Fonts are totally irrelevant here. Selection is not a part of the document; it is a part of the user's working session with the document; it is irrelevant, unless you do automation (why?). Then "highlighting" needs clarification.

Whatever you do, you can either use Office interop assembly, or Open XML SDK. Please see my past answers referenced in this answer: How to add microsoft excel 15.0 object library from Add Reference in MS Visual Studio 2010[^].

—SA