View Single Post
  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
ThomasAJ ThomasAJ is offline
external usenet poster
 
Posts: 21
Default How to embed Control Characters into data feeding a merge fiel

Thanks Peter. Interesting but too complicated for my task.

Also it's interesting that embeded CRLFs in text data feeding a merge field
causes Word to start a new line within that merge field.

Are you all 100% sure that special ASCII/ANSI chars (eg the one for bold)
will NOT display a word in bold? Just pushing this a little further

--
Regards
Tom


"Peter Jamieson" wrote:

You can try the following trick if you like but be aware that it has
significant limitations (e.g. you probably can't have more than the maximum
Word column count) so test thoroughly before committing:

Instead of writing a plain text file, write an HTML format file, using
standard HTML formatting tags. As faras I know you can reduce the amount of
HTML you need by leaving out HTML, BODY. But keep the table tags.

e.g.

table
trtdkey/tdtdtext/td/tr
trtd1/tdtdplain1 bbold and iitalic/i/b/td/tr
trtd2/tdtdplain2 uunderscore/u/td/tr
/table

You can use th instead of td in the header line (I doubt if it makes any
difference to Word, but it might). Make sure every row has the same number
of cells. Give the file a .htm extension.

Use that as the data source, but instead of inserting MERGEFIELD fields,
insert REF fields, e.g. { REF k } and { REF text }. You will probably also
need to insert one "real" merge field that evaluates to an empty text string
before Word will let you perform the merge. e.g. { { MERGEFIELD k } } may do
the trick.

When you evaluate these fields, you will probably see "Error! Reference
source not found", but if you preview the data, you should see the data +
formatting that you included.

This relies on the fact that the earliest versions of Windows Word could
only use Word documents as a data source, did not have { MERGEFIELD }
fields, and just used { fieldname } instead of { MERGEFIELD fieldname }. The
behaviour seems to have been carried through until at least Word 2003, but
is probably not supported. Using REF is a way to avoid problems where the
fieldname is the same as a Word field type such as AUTHOR etc.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"ThomasAJ" wrote in message
...
I have a merge field that gets fed text type data from a database.

Somewhere within the text source I want to say highlight a PORTION by
making
it bold (note - NOT the whole field). What control characters do I embed?.
Is
there a list of other control chars. say italic etc.

--
Regards
Tom