VSTO查找Word文档的ContentControls
有没有办法使用 VSTO 查找 WordDocument 的所有 ContentControl(包括页眉、页脚、文本框...中的 ContentControl)?
Microsoft.Office.Tools.Word.Document.ContentContols 仅返回主文档的 ContentControl,而不返回页眉/页脚内的 ContentControl。
Is there a way to find all ContentControls of a WordDocument (including ContentControls in Headers, Footers, TextBoxes ...) using VSTO?
Microsoft.Office.Tools.Word.Document.ContentContols returns only the ContentControls of the Main-Document, not the one inside the Headers/Footer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
复制自 http://social. msdn.microsoft.com/Forums/is/vsto/thread/0eb0af6f-17db-4f98-bc66-155db691fd70
Copied from http://social.msdn.microsoft.com/Forums/is/vsto/thread/0eb0af6f-17db-4f98-bc66-155db691fd70
试试这个:
如果这不起作用,请尝试迭代文档的 故事范围
Try this:
If that doesn't work try to iterate on all ranges (for contentcontrols) in a document's StoryRanges
我正在处理同样的问题,但从 MATLAB 驱动 Word。 Word MVP 的此页面为我解决了问题:
http://www. word.mvps.org/FAQs/MacrosVBA/FindReplaceAllWithVBA.htm
本质上,您必须:
I'm dealing with the same problem, but driving Word from MATLAB. This page by a Word MVP solved the problem for me:
http://www.word.mvps.org/FAQs/MacrosVBA/FindReplaceAllWithVBA.htm
Essentially, you have to: