Chris Ward
Posts: 1
Joined: 2008-12-12
|
Hi,
I'm not a professional developer, so please bear with me. I'm trying to create wrapper classes for word documents in VB.Net Express. For a long time, I couldn't figure out even how to access the AddinModule WordApp property (ie, the Word Application instance) from my document wrapper class. I needed to do that so that I could create an instance of a Word document inside my wrapper class. I finally did it by using a delegate. My Sub New() takes a delegate as a parameter from the Addin Module and then uses the delegate to call back to a function in the Addin Module that returns the WordApp property/Application instance. Then my Sub New() uses the Word Application Instance to create a new document from a template and add it to the documents collection. So far, so good. When I run the application, it opens a new document just fine.
My problem comes when I try to access any of the document's properties and methods through the Word object model. My wrapper class has a read only public property called DocumentInstance, which is set to the private document member variable. Any call to DocumentInstance, for example, MsgBox(DocumentInstance.Paragraphs.Count), causes Word to crash.
Anybody know what I'm doing wrong?
Any help would be greatly appreciated. :D |
|
Eugene Astafiev
Guest
|
|