开发者

add bookmark in word at runtime

开发者 https://www.devze.com 2023-01-20 22:19 出处:网络
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 crea开发者_开发百科te the ob

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 crea开发者_开发百科te the object of ControlCollection, it throws and error because this class has no constructor defined...

How can I add a bookmark in word document?


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

0

精彩评论

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

关注公众号