getpfsi Posted November 5, 2003 Posted November 5, 2003 Hi, I have a piece that works perfectly on Word 2002, but cannot even open a document in word 97 for whatever reason. The code is done in VB .net. I started with: Dim WordObject as Word.Application Dim WordDoc as Word.Document WordObject = CreateObject("Word.Application") WordObject.Visible = True After this, I tried to open a document using add and open, but neither could open a document. Everytime it ran the code, it gave the error "object reference not set to an instance of an object". any ideas about what the problem is? Thanks Quote
Moderators Robby Posted November 5, 2003 Moderators Posted November 5, 2003 Did you add the correct reference to the Word object in the solution explorer (References) Quote Visit...Bassic Software
getpfsi Posted November 5, 2003 Author Posted November 5, 2003 I added the Microsoft Word 10.0 Object Library, I'm not sure if Word 97 is not compliant with that or what the issue is. I found an article that said the application variable should be declared as Word.ApplicationClass and document variable shuold be declared as Word.DocumentClass for Word 97. I did that, but still got the same error. Quote
Recommended Posts