Word in a WinForm

I

Iain

I'm struggling to embed a word document in a winform application and access
the document object to automate it.

I've found http://support.microsoft.com/default.aspx?scid=KB;en-us;304662

But the code won't compile. There seems to be some conflict between the
Browser control and the SHDocVw bits.

I can get the document loaded OK, but the event mentioned in the KB article
does not seem to exist and I can find no way of getting at and binding the
instance of the document to a Word._Document object.

I can't find anything particularly useful through google and to make
matters worse, I'm using an x64 OS which may well be having issues with
64/32 bit widths (though I don't think I've got there yet).

So, simply put. In VS2005 I can load a word document in to a browser
window. How do I get teh Word Document object from it?

Iain
 
C

Chris Jobson

Iain said:
I'm struggling to embed a word document in a winform application and
access
the document object to automate it.

I've found http://support.microsoft.com/default.aspx?scid=KB;en-us;304662

But the code won't compile. There seems to be some conflict between the
Browser control and the SHDocVw bits.

I can get the document loaded OK, but the event mentioned in the KB
article
does not seem to exist and I can find no way of getting at and binding the
instance of the document to a Word._Document object.

I can't find anything particularly useful through google and to make
matters worse, I'm using an x64 OS which may well be having issues with
64/32 bit widths (though I don't think I've got there yet).

So, simply put. In VS2005 I can load a word document in to a browser
window. How do I get teh Word Document object from it?

I haven't found a way using the WebBrowser control in VS2005, but you can
still add the "old" one to the toolbox by following step 2 in the link you
give (i.e. the step it says is not necessary with VS2005). If you then use
that control (it appears in my toolbox as "Microsoft Web Browser") the code
given in the KB article works perfectly.

Chris Jobson
 
I

Iain

I haven't found a way using the WebBrowser control in VS2005, but you can
still add the "old" one to the toolbox by following step 2 in the link you
give (i.e. the step it says is not necessary with VS2005). If you then use
that control (it appears in my toolbox as "Microsoft Web Browser") the code
given in the KB article works perfectly.

Chris Jobson

Thank you. As you say this seems to work OK. If any microsofties are
scanning the list then perhpas they could fix the KB article?


Iain
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top