Re: Table of Contents says "this file could not be found"



Alternatively you may be able to use a nested field such as

{ RD "{ FILENAME \p }\\..\\some headings for a toc.doc" }

to get the right path. All the {} need to be the special field code braces that you can enter using ctrl-F9

Peter Jamieson

http://tips.pjmsn.me.uk

Peter Jamieson wrote:
If you only have the file name in the rd field, e.g.

{ rd "some headings for a toc.doc" }

then Word will look in the "Active directory" for the file specified in the field.

However, the active directory is not necessarily the directory where the document containing the rd is located (this problem has historically blighted the use of "relative" file names in Word). For example, if you use Insert->Object->Text from file, and navigate to a different folder to insert a chunk of text, the active directory will no longer be the one that contains your document, and if for example you then try to update a TOC, it will fail in much the way you describe.

So if for example you do Insert->Object->Text from file and insert an empty file from the folder containing your document, you /may/ find that it works again. Othwerwise, something else is wrong as well.

Alternatively, if you can live with absolute references, you need the full pathname with backslashes doubled up, e.g.

You probably need to provide double up your backslashes, e.g.

{ rd "c:\\a\\some headings for a toc.doc" }

(This type of problem has historically afflicted many types of reference within Word)

Peter Jamieson

http://tips.pjmsn.me.uk

Anne wrote:
Hi Stefan,

I've just re-checked it, and though I don't literally type the path in the RD field, when trying to update, in the window which comes up, I see it automatically puts C:\ in front of my document name whilst telling me it couldn't be found. Should it also automatically contain the foldername? If it should, I don't know how to do this!!

"Stefan Blom" wrote:

Which version of Word are you using? Assuming that you are making use of RD fields, did you specify full or relative paths to the files?

--
Stefan Blom
Microsoft Word MVP



"Anne" <Anne@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:F72AD65A-FDFF-4A3E-A62F-ED6939DB60F9@xxxxxxxxxxxxxxxx
Have set up TOC doc to gather headings from several other documents. It's
been working very well but suddenly when updating it, it says "this file
could not be found" and also "Error! cannot open file referenced on page
1".
All documents and TOC doc are in the same folder. This happened the other
day and the following day the TOC updated beautifully! Today it's
refusing
to update again. I've been having trouble with headers in the other
documents (now apparently solved) and maybe have inadvertently done
something
incorrectly. Would be over the moon if someone could help me!



.



Relevant Pages

  • Re: Table of Contents says "this file could not be found"
    ... indeed copied text from other files, but from the same folder. ... the active directory is not necessarily the directory where the ... Alternatively, if you can live with absolute references, you need the ... All documents and TOC doc are in the same folder. ...
    (microsoft.public.word.docmanagement)
  • Re: Table of Contents says "this file could not be found"
    ... {rd "some headings for a toc.doc"} ... the active directory is not necessarily the directory where the document containing the rd is located. ... For example, if you use Insert->Object->Text from file, and navigate to a different folder to insert a chunk of text, the active directory will no longer be the one that contains your document, and if for example you then try to update a TOC, it will fail in much the way you describe. ... Alternatively, if you can live with absolute references, you need the full pathname with backslashes doubled up, e.g. ...
    (microsoft.public.word.docmanagement)
  • Re: Table of Contents across documents
    ... look up RD codes in Word help. ... order for it to work that way, Word's active directory has to be the folder ... this macro to set the active directory before updating the TOCs. ... > I have a very large manual that I want to create a TOC for. ...
    (microsoft.public.word.docmanagement)
  • Re: Table of Contents says "this file could not be found"
    ... "Peter Jamieson" wrote: ... the active directory is not necessarily the directory where the ... Alternatively, if you can live with absolute references, you need the ... All documents and TOC doc are in the same folder. ...
    (microsoft.public.word.docmanagement)
  • Re: Question on Tools/Options/File Locations...
    ... I feel that Solidworks does a poor job of finding referenced files. ... I have a projects folder and within that all my different jobs are ... external references" - Checked or unChecked ... Assemblies will search for referenced components in three places in the ...
    (comp.cad.solidworks)

Loading