I am creating an index using RD fields (the Index field is in one document with RD fields that reference the documents that should be included in the index). The RD fields do not specify a path because all of the files are in the same directory. For example, {RD “file to be indexed.doc”}
If I open my index.doc file using File-Open (navigating to the correct directory), then everything works fine. If I happen to open index.doc from Explorer, where I don’t navigate using File-Open, then updating the index gives an error, something like “Word cannot find the file C:My Documents|File to be indexed.doc,” if Word’s default Documents location is C:My Documents.
I tried writing a macro with the first line being:
ChDir ActiveDocument.Path
To me, that should tell Word to change its current path to the location of the open document. If I follow that line up with:
If CurDir ActiveDocument.Path then Stop
And Word thinks everything is fine. It *thinks* its current path is the right one. If I update my index, though, I still get the error. If I click File-Open after getting the error, C:My Documents is the directory displayed.
Is there something I’m missing, or is this a bug in the index process? Have I misunderstood the ChDir function?
Thanks,
Bob