tags:

views:

25

answers:

1

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...

please suggest as how to add bookmark in word document...

Thanks in advance...

A: 

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

Sambhaji