View Single Post
  #19   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Merging pictures

Thanks Doug.

Of course I'd wrapped the INCLUDETEXT in an IF so that all it appears to
do is check the result, but my test jpegs are quite small so maybe they
just don't trigger the problem.

without the \c recover, I get the File Conversion dialog box in which I
get the opportunity to select the encoding that makes your document
readable.


Yes, in Word 2007, using the Recover text from any file converter was
the only way I could find a couple of years ago to prevent Word from
popping up the encoding dialog. Most of the other converters are
unlikely to work at all as they probably wouldn't recognise the format
as valid. I guess it would be possible to write a converter that's
associated with .jpg files and just returns a short string whatever the
file content, but then you have to distribute and maintain the darned
thing. Even then, unless the new text file conversion interface in Word
2007 SP2 works differently in this respect, Word always checks file
existence itself so you still have to deal with merge-time errors.

It's a pity word does not have an { IF ERROR } field.


Yes. Seems unlikely to happen these days though...


Peter Jamieson

http://tips.pjmsn.me.uk

Doug Robbins - Word MVP wrote:
Peter,

Using

{INCLUDETEXT {IF TRUE "C:\\Test_Files\\ThisFileDoesNotExist.JPG"} \c
Recover }

results in nothing being displayed in 2007, but using

{INCLUDETEXT {IF TRUE "C:\\Test_Files\\ThisFileDoesExist.JPG"} \c Recover }

sort of predictably results in the following error message:

"There are too many spelling or grammatical errors in Document1 to
continue displaying them. To check the spelling and grammar of this
document, choose Spelling and Grammar from the Review tab."

without the \c recover, I get the File Conversion dialog box in which I
get the opportunity to select the encoding that makes your document
readable.

It's a pity word does not have an { IF ERROR } field.