Errors reverting code from Word 2003 to support Word 2000 Message List

S

Scott

Hi,

I was so proud; I created a working application that generated a
beautifully formatted document to the customers specifications. I
coded this against the MS Word 11.0 object library only to find out
later that the customer is using Word 2000 (v. 9.0) and has no
intentions of upgrading to Word 2003. This has forced me to revert
my code so that it supports the older version. I have installed Word
2000 on a separate development box so that I can appropriately
reference the following .DLL's:

MS Office 9.0 Object Library
MS Visual Basic for Applications Extensibility 5.3
MS Word 9.0 Object Library

The imports statement for Word 2003, 'Imports Word =
Microsoft.Office.Interop.Word' no longer seems to apply so I now
have only 'Imports Word'

On the Class-level, I then:
Dim oWord as Word.Application
Dim oDoc as Word.Document
Dim oPara3 as Word.Paragraph


When I am ready to start building my document I start with the
following command:

oDoc = oWord.Documents.Add


All of the early binding that I have mentioned gives no errors but I
still end-up with a 'gazillion' error messages of the following
nature-->

Error:
"Interface 'Word.Bookmarks' cannot be indexed because it has no
default property."

Applying to line:
oPara3 = oDoc.Content.Paragraphs.Add(oDoc.Bookmarks
("\endofdoc").Range)


I'm really hoping this is a simple configuration reference and have
not coded Word 2003-specific functionality.

Any help in determining what is causing this would be greatly
appreciated.

Thanks,

Scott Wheeler
 
J

Jonathan West

Scott said:
Hi,

I was so proud; I created a working application that generated a
beautifully formatted document to the customers specifications. I
coded this against the MS Word 11.0 object library only to find out
later that the customer is using Word 2000 (v. 9.0) and has no
intentions of upgrading to Word 2003.

You *must ask* this right at the beginning of a project, and get the answer
in writing.
This has forced me to revert
my code so that it supports the older version. I have installed Word
2000 on a separate development box so that I can appropriately
reference the following .DLL's:

MS Office 9.0 Object Library
MS Visual Basic for Applications Extensibility 5.3
MS Word 9.0 Object Library

The imports statement for Word 2003, 'Imports Word =
Microsoft.Office.Interop.Word' no longer seems to apply so I now
have only 'Imports Word'

On the Class-level, I then:
Dim oWord as Word.Application
Dim oDoc as Word.Document
Dim oPara3 as Word.Paragraph


When I am ready to start building my document I start with the
following command:

oDoc = oWord.Documents.Add


All of the early binding that I have mentioned gives no errors but I
still end-up with a 'gazillion' error messages of the following
nature-->

Error:
"Interface 'Word.Bookmarks' cannot be indexed because it has no
default property."

Applying to line:
oPara3 = oDoc.Content.Paragraphs.Add(oDoc.Bookmarks
("\endofdoc").Range)

Try changing that to this

oPara3 = oDoc.Content.Paragraphs.Add(oDoc.Bookmarks.Item("\endofdoc").Range)
I'm really hoping this is a simple configuration reference and have
not coded Word 2003-specific functionality.

You probably have coded in some Word 2003-specific functionality somewhere.
On the basis of the information provided so far, there is no knowing where.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
S

Scott

Jonathan,

Thanks for the reply. I think I have found a solution. I have installed
the 'MS Office XP PIAs' on my box with Word 2000 and pointed to those
in the VS2005 project assembly references. Everything seems to be
working fine now. The test will be to do the same on my primary
development box and see how Word 2003 responds.

Scott
 

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