IncludeText if file exists

  • Thread starter Thread starter Jules
  • Start date Start date
J

Jules

Is there a way in wording using fields that I can check if a file exists so
that if I use includetext and the file does not exist I do not get the Not a
Valid File Name error?
Thank you
 
You could use an If...then...Else field construction that checks for the
(exact) error message

{ IF { INCLUDETEXT "PATH/FILENAME" } <> "Error! Not a Valid FileName" {
INCLUDETEXT "PATH/FILENAME" } }

You will have to quote the exact error message in place of "Error! Not a
Valid FileName" for this to work.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
Thanks very much, exactly what I needed.

Doug Robbins - Word MVP said:
You could use an If...then...Else field construction that checks for the
(exact) error message

{ IF { INCLUDETEXT "PATH/FILENAME" } <> "Error! Not a Valid FileName" {
INCLUDETEXT "PATH/FILENAME" } }

You will have to quote the exact error message in place of "Error! Not a
Valid FileName" for this to work.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
Back
Top