Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Jules Jules is offline
external usenet poster
 
Posts: 51
Default IncludeText if file exists

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
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default IncludeText if file exists

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

"Jules" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default IncludeText if file exists

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

"Jules" wrote in message
...
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


  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Jules Jules is offline
external usenet poster
 
Posts: 51
Default IncludeText if file exists

Thanks very much, exactly what I needed.

"Doug Robbins - Word MVP" wrote:

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

"Jules" wrote in message
...
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


  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Jules Jules is offline
external usenet poster
 
Posts: 51
Default IncludeText if file exists


Thanks very much, exactly what I needed.

"Doug Robbins - Word MVP" wrote:

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

"Jules" wrote in message
...
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


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
my file still exists but is blank please help hanna Microsoft Word Help 1 November 25th 09 10:12 AM
The file normal already exists!! inenewbl Microsoft Word Help 1 June 15th 07 06:18 AM
Check if file exists FUBARinSFO Mailmerge 3 February 23rd 07 06:11 PM
The file normal.dot already exists Ron Boetger New Users 1 February 24th 06 10:20 AM
Normal File already exists? Tieu New Users 4 December 28th 04 02:30 PM


All times are GMT +1. The time now is 06:30 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"