Douglas H. Troy

System Config(s):
Windows Vista Ultimate with Office Ent. 2007
Office 2007 PIAs
VSTO 2005 SE (have also tried with original VSTO 2005)

also tried on

Windows XP with Office Ent. 2007

VSTO Solution:
Word Template Document-Level Customization
Basic test application that contains a custom Action Pane with a button. The click event of that button creates an instance of a custom WinForm control and adds that control to the ThisDocument Controls collection.

Code ExampleCustomControl customControl = new CustomControl();
Globals.ThisDocument.Controls.Add(customControl, rng, 120, 80, customControl.Name);


Problem:
On Windows XP running Office 2007, this works fine.
Under Windows Vista I am receiving the following error:
The program used to create this object is WinForms. That program is not installed on your computer. To Edit this object, you must install a program that can open the object.
The exception is thrown on Controls.Add(...)

Obviously, I went looking on the Office 2007 CD to ensure I have installed all components that might resolve this issue ... I have ...

What am I missing here



Re: Visual Studio Tools for Office WinForms Object Error (Windows Vista & Office 2007)

Douglas H. Troy

Well, I'm caulking this one up to an odd-ball installation of Vista. Our QA group installed Vista and Office 2007 on a lab machine and they are not getting this error. I would still love to know why this happened, but I will scrub my test machine, reinstall Vista and Office 2007 on it, and see what falls out.

In the meantime, if one of you kind Microsoft VSTO types would like to close this issue off, feel free.

If this happens again, I'll repost with more detailed information.





Re: Visual Studio Tools for Office WinForms Object Error (Windows Vista & Office 2007)

Sstar

Hi, Douglas,

Have you found out why you get the error in your testing machine If yes, could you share with me the reason

I found a similar problem in Office 2007 Word Macro code, in which I have the following codes,

Set newShape = Application.ActiveDocument.Shapes.AddOLEObject("ObjectName.Control.1", Anchor:=Application.Selection.Range)

In above code, the Object to be inserted into Word 2007 is an ActiveX object. Just like what you experienced, the code works fine when my software is installed into Office 2007 on Windows XP SP2 but they will give a similar error for Office 2007 on Windows Vista.

Best Regards

Eric






Re: Visual Studio Tools for Office WinForms Object Error (Windows Vista & Office 2007)

Douglas H. Troy

Eric,

I never did find an actual solution to this problem. The machine I was original testing on, had previously been installed with Vista RC1, RC2 and finally the RTM release. My QA group installed Vista onto a machine directly from a boxed DVD and they do NOT have the problems I'm seeing on my test machine.

I had planned to format that machine and install Vista from our MSDN DVD, but since being committed to getting our solution working on Office 2007 under Windows XP, I've not yet had the chance.

Needless to say, this one is currently an "X-File" ...