开发者

VSTO: Event for Word Doc's Content/Text Changes?

Does anyone know whether it's possible to handle content changes or more precisely whether there's an event for 开发者_开发百科that... one that would notify me if a document's content has been changed (ideally at what position/range etc)?


This is not possible anymore. In Office 2007 and below you could use smart tags and create a custom smart tag, which get called back into when content changes, but they were removed in Office 2010 :(

I think that a Timer is the only way to go, unfortunately you would have to make sure you did not kill performance of word if taking this approach..


The event is "Application.WindowSelectionChange" that will notify of any content changes, but it doesn't notify of what changed like location/position - you'll have program in what you want to look for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜