Unable to call method: GetVstoObject

1.8k Views Asked by At

All, Cannot

I have created a Word2007 Document Project and I'm trying to retrieve the content controls on the page via the GetVSTOObject method but it can not find the Microsoft.Office.Tools.Word.Extensions library after I have referenced the Microsoft.Office.Tools.Word.v9.dll as suggested on the MSDN site.

I would greatly appreciate any help.

Below is the error message:

'Microsoft.Office.Interop.Word.Document' does not contain a definition for 'GetVstoObject' and no extension method 'GetVstoObject' accepting a first argument of type 'Microsoft.Office.Interop.Word.Document' could be found (are you missing a using directive or an assembly reference?)

1

There are 1 best solutions below

5
On BEST ANSWER

Make sure that you add a using statement for the extensions namespace:

using Microsoft.Office.Tools.Word.Extensions;

If you already did this, can you share the code where you are trying to use the extension method?

Edit: As you can see in the image you're using Visual Studio 2008 RTM (Release To Manufacturing) version and you have not installed the Visual Studio SP1. The SP1 mentioned in the right is for the .NET Framework.

About Dialog for Visual Studio http://img337.imageshack.us/img337/9041/vs2008sp1.png

Try installing the SP1 for Visual Studio. You can download it from here.