tags:

views:

299

answers:

1

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?)

A: 

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

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

João Angelo
I can't even get that to show up when trying to include it into the code.Here's a link to what is available and it also shows some references.[URL=http://img406.imageshack.us/i/issueo.png/][IMG]http://img406.imageshack.us/img406/9066/issueo.png[/IMG][/URL]
AProgrammer
Are you using Visual Studio 2008 Service Pack 1 (SP1)?
João Angelo
Yes I am.[URL=http://img697.imageshack.us/i/vs2008sp1.png/][IMG]http://img697.imageshack.us/img697/9041/vs2008sp1.th.png[/IMG][/URL]
AProgrammer
See the edit to my answer.
João Angelo
I'm going to do the install right now. I'll report back with success or not. You guys have been an immense help thus far and I appreciate it.
AProgrammer
Following up. Installing SP1 made everything work out! Thanks a ton fellow coders.
AProgrammer