在运行时在word中添加书签
我必须使用 Microsoft.Office.Tools.Word.ControlCollection
AddBookmark 方法在 ControlCollection 类中可用,在 Word 文档中添加书签,但是当我尝试创建以下对象时 ControlCollection,它抛出错误,因为此类没有定义构造函数...
如何在Word文档中添加书签?
I Have to add a bookmark in Word doc using Microsoft.Office.Tools.Word.ControlCollection
AddBookmark method is available in ControlCollection class, however when I try to create the object of
ControlCollection, it throws and error because this class has no constructor defined...
How can I add a bookmark in word document?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AddBookmark 方法可用于 Microsoft.Office.Tools.Word.Document 类的实例。
我不知道如何在 Microsoft.Office.Tools.Word.Document 类中加载文档。
但是,有一种方法“DocumentExtensions.GetVstoObject”可以从 Microsoft.Office.Interop.Word.Document 对象返回 Microsoft.Office.Tools.Word.Document 对象。 Microsoft.Office.Tools.Word.v4.0.Utilities 程序集中定义的 DocumentExtensions 类。但我在“添加引用”对话框中找不到该程序集...看起来该程序集仅在 .net 4.0 中可用..
---Sambhaji
The AddBookmark method is available on instance of Microsoft.Office.Tools.Word.Document class.
I dont know how to load document in Microsoft.Office.Tools.Word.Document class.
However,There is one method "DocumentExtensions.GetVstoObject" available that returns a Microsoft.Office.Tools.Word.Document object from Microsoft.Office.Interop.Word.Document object. The DocumentExtensions class defined in Microsoft.Office.Tools.Word.v4.0.Utilities assembly. But I do not find this assembly in Add reference dialog... It looks like this assembly available only in .net 4.0..
---Sambhaji