Tom_Stevens

Hi guys

I've got a simple customization that runs fine when the document is opened in the normal fashion. However i'm trying to open the doc from a client side script:

Code Snippet

wdapp=new ActiveXObject("Word.Application"); // creates new blank document

wdapp.Documents.Add(data, false);

wdapp.Visible=true; // makes application visible

wdapp.WindowState=1; // maximises Application window

wdapp.Activate(); // activates the application

window.close();

which opens the doc fine but the customization doesn't run. Has anyone else had similar issues

Cheers

Tom



Re: Visual Studio Tools for Office Word Customization not loading when document loaded via ActiveX (javascript)

Cindy Meister

Hi Tom

Well, if you're trying to OPEN a VSTO document (*.doc) then you should be using the Open method, not the Add method. Add is the equivalent of File/New (from template) and wouldn't trigger the startup event for a document project. You'd need a template project.






Re: Visual Studio Tools for Office Word Customization not loading when document loaded via ActiveX (javascript)

Tom_Stevens

Hi Cindy,

Yes i gave that a whirl and indeed something happens...namely word now refuses to load. I get the hour glass. but no word. The project is running but the app isn't loading any reason why that would happen

Cheers

Tom





Re: Visual Studio Tools for Office Word Customization not loading when document loaded via ActiveX (javascript)

Cindy Meister

Best guess would be that you're getting a message box that's blocking the app from continuing, because it's waiting for user response. Could be something to do with the document. A warning that it can't be run because of insufficient permissions, for example. If you try to open the document from the data path directly in Word ("by hand") do you see anything of that nature




Re: Visual Studio Tools for Office Word Customization not loading when document loaded via ActiveX (javascript)

Tom_Stevens

Cindy you're a star!

I was infact using an old test dll in the directory as the customization which has a MessageBox popping up.

Thanks for the really quick responses.

Tom