What's the value of nMarks at the time of error? Is it 0?
>In an application that has run without errors for several years, we've suddenly started getting an "invalid subscript reference" error in the Word automation routine. It occurs on the Dimension command. The value of nMarks varies between 2 and 20 so I doubt the array is too large. I have been unable to duplicate the error in my office, but can easily produce it by running the application on the client's server (via Terminal Services.) Any idea what has happened?
>
>
>nMarks = oDocCopy.bookmarks.count()
>
>DIMENSION aMark[nMarks]
>FOR i = 1 TO nMarks
> aMark(i) = UPPER(oDocCopy.bookmarks(i).name)
>ENDFOR
>
>
--sb--