RTE 5941 The requested member of the collection does not exist

G

Guy Cohen

Hi All
I use VB6 + Word97 late binding.

In my application I use docVariables to put a info in a word document.

The code that raise the error looks like this:
-
Set wField = WordDoc.Fields(WordDoc.Variables("tblTravels").Index)
-
wField is declared as object

When I looked in the watch window :

WordDoc.Variables("tblTravels").Index = 22

So I dont understand why it is not found in the collection.
 
J

Jonathan West

There are two collections being referenced in that line of code, the
Variables collection and the Fields collection. Does your document have at
least 22 fields in it? What is the value of WordDoc.Fields.Count at the time
you reach that line of code?
 

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