Group:  Microsoft Word ยป microsoft.public.word.mailmerge.fields
Thread: Ho do I control the length of a mergefield

Geek News

Ho do I control the length of a mergefield
Matt Heason 10/27/2008 11:03:02 AM
Hi,
I am runing a basic mailmerge using an excel spreadsheet. one of the
mergefields has some instances that are over 43 words long. When this happens
the merged field in the final document is truncated at 43 words. How do I
control the length of the mergefield to allow all of the words to be
displayed?

Thanks,
Matt
Re: Ho do I control the length of a mergefield
Walter Briscoe <wbriscoe[ at ]nospam.demon.co.uk> 10/27/2008 1:08:44 PM
In message <1732D896-1D79-4320-B8D2-6758E399E9AE[ at ]microsoft.com> of Mon,
27 Oct 2008 04:03:02 in microsoft.public.word.mailmerge.fields, Matt
Heason <Matt[ at ]Heason.?.microsoft.com.invalid> writes
[Quoted Text]
>Hi,
>I am runing a basic mailmerge using an excel spreadsheet. one of the
>mergefields has some instances that are over 43 words long. When this happens
>the merged field in the final document is truncated at 43 words. How do I
>control the length of the mergefield to allow all of the words to be
>displayed?

It might be a good thing to say what versions you are using.
This is a well known problem. I decided to demonstrate it in Office
2003. I constructed an excel file with the following data:
Name
first
second
third
fourth
fifth
sixth
seventh
eighth
long field 12345678 2 2345678 3 ... 5678 a 2345 ... 5678 y 23456789z

i.e. I had a column called name and I had a field consisting of about
350 characters after the eighth line. The field was truncated at 254
characters in the merge output.
The fix is to put a dummy field of 255 or more bytes in the first eight
records. There is another fix which requires change of a registry datum
to alter the number eight, but I take no notice of that because it
affects all merges on a particular system.

Basically, office has short and long string type and office uses the
contents of the first eight excel rows to select between short and long
strings. A short string can hold 255 bytes but one gets lost somewhere
for technical reasons of which I care nothing - it is probable either a
count byte or a zero terminator.

To the astonishingly wonderful and patient MVPs who monitor this group:
why is their not an FAQ for this group?

I would have referred to the FAQ rather than constructing a problem
demonstration and fix if an FAQ existed.
--
Walter Briscoe
Re: Ho do I control the length of a mergefield
Matt Heason 10/27/2008 1:47:01 PM
Hi,
I am runing Office 2007.
Can't quite get ny head around your explanation.
My spreadsheet consists of columns A through to AI (the one in question,
with the longer text descriptions, is AH), and around 240 rows. It is row 7,
column AH that is the first description which is affected...

Matt

"Walter Briscoe" wrote:

[Quoted Text]
> In message <1732D896-1D79-4320-B8D2-6758E399E9AE[ at ]microsoft.com> of Mon,
> 27 Oct 2008 04:03:02 in microsoft.public.word.mailmerge.fields, Matt
> Heason <Matt[ at ]Heason.?.microsoft.com.invalid> writes
> >Hi,
> >I am runing a basic mailmerge using an excel spreadsheet. one of the
> >mergefields has some instances that are over 43 words long. When this happens
> >the merged field in the final document is truncated at 43 words. How do I
> >control the length of the mergefield to allow all of the words to be
> >displayed?
>
> It might be a good thing to say what versions you are using.
> This is a well known problem. I decided to demonstrate it in Office
> 2003. I constructed an excel file with the following data:
> Name
> first
> second
> third
> fourth
> fifth
> sixth
> seventh
> eighth
> long field 12345678 2 2345678 3 ... 5678 a 2345 ... 5678 y 23456789z
>
> i.e. I had a column called name and I had a field consisting of about
> 350 characters after the eighth line. The field was truncated at 254
> characters in the merge output.
> The fix is to put a dummy field of 255 or more bytes in the first eight
> records. There is another fix which requires change of a registry datum
> to alter the number eight, but I take no notice of that because it
> affects all merges on a particular system.
>
> Basically, office has short and long string type and office uses the
> contents of the first eight excel rows to select between short and long
> strings. A short string can hold 255 bytes but one gets lost somewhere
> for technical reasons of which I care nothing - it is probable either a
> count byte or a zero terminator.
>
> To the astonishingly wonderful and patient MVPs who monitor this group:
> why is their not an FAQ for this group?
>
> I would have referred to the FAQ rather than constructing a problem
> demonstration and fix if an FAQ existed.
> --
> Walter Briscoe
>
Re: Ho do I control the length of a mergefield
"Peter Jamieson" <pjj[ at ]KillmapSpjjnet.demon.co.uk> 10/27/2008 2:31:34 PM
The problem is that if none of the first 8 cells in the "problem column"
contain a "long" text (i.e. a wso-called "memo" text, which in the case of
Excel means a text over 255 characters long), all the texts in that column
will be truncated to 255 characters, or worse. The trouble is that there is
no simple fix that is likely to suit everyone. The suggestion Walter
provided is one approach. Switching the connection method to DDE is another,
but that has its own problems, particularly with Office 2007. There is a
more detailed explanation at http://tips.pjmsn.me.uk but I cannot guarantee
that even that tells the whole story.

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

"Matt Heason" <MattHeason[ at ]discussions.microsoft.com> wrote in message
news:555052AE-471C-4B95-A392-5F1214485138[ at ]microsoft.com...
[Quoted Text]
> Hi,
> I am runing Office 2007.
> Can't quite get ny head around your explanation.
> My spreadsheet consists of columns A through to AI (the one in question,
> with the longer text descriptions, is AH), and around 240 rows. It is row
> 7,
> column AH that is the first description which is affected...
>
> Matt
>
> "Walter Briscoe" wrote:
>
>> In message <1732D896-1D79-4320-B8D2-6758E399E9AE[ at ]microsoft.com> of Mon,
>> 27 Oct 2008 04:03:02 in microsoft.public.word.mailmerge.fields, Matt
>> Heason <Matt[ at ]Heason.?.microsoft.com.invalid> writes
>> >Hi,
>> >I am runing a basic mailmerge using an excel spreadsheet. one of the
>> >mergefields has some instances that are over 43 words long. When this
>> >happens
>> >the merged field in the final document is truncated at 43 words. How do
>> >I
>> >control the length of the mergefield to allow all of the words to be
>> >displayed?
>>
>> It might be a good thing to say what versions you are using.
>> This is a well known problem. I decided to demonstrate it in Office
>> 2003. I constructed an excel file with the following data:
>> Name
>> first
>> second
>> third
>> fourth
>> fifth
>> sixth
>> seventh
>> eighth
>> long field 12345678 2 2345678 3 ... 5678 a 2345 ... 5678 y 23456789z
>>
>> i.e. I had a column called name and I had a field consisting of about
>> 350 characters after the eighth line. The field was truncated at 254
>> characters in the merge output.
>> The fix is to put a dummy field of 255 or more bytes in the first eight
>> records. There is another fix which requires change of a registry datum
>> to alter the number eight, but I take no notice of that because it
>> affects all merges on a particular system.
>>
>> Basically, office has short and long string type and office uses the
>> contents of the first eight excel rows to select between short and long
>> strings. A short string can hold 255 bytes but one gets lost somewhere
>> for technical reasons of which I care nothing - it is probable either a
>> count byte or a zero terminator.
>>
>> To the astonishingly wonderful and patient MVPs who monitor this group:
>> why is their not an FAQ for this group?
>>
>> I would have referred to the FAQ rather than constructing a problem
>> demonstration and fix if an FAQ existed.
>> --
>> Walter Briscoe
>>

Re: Ho do I control the length of a mergefield
Matt Heason 10/27/2008 3:10:13 PM
Fantastic! That solved it for me. Easy enough to discard the first record
from the final merged document so an esy fix. A fairly basic issue though!

Thanks again.
Matt Heason

"Peter Jamieson" wrote:

[Quoted Text]
> The problem is that if none of the first 8 cells in the "problem column"
> contain a "long" text (i.e. a wso-called "memo" text, which in the case of
> Excel means a text over 255 characters long), all the texts in that column
> will be truncated to 255 characters, or worse. The trouble is that there is
> no simple fix that is likely to suit everyone. The suggestion Walter
> provided is one approach. Switching the connection method to DDE is another,
> but that has its own problems, particularly with Office 2007. There is a
> more detailed explanation at http://tips.pjmsn.me.uk but I cannot guarantee
> that even that tells the whole story.
>
> --
> Peter Jamieson
> http://tips.pjmsn.me.uk
>
> "Matt Heason" <MattHeason[ at ]discussions.microsoft.com> wrote in message
> news:555052AE-471C-4B95-A392-5F1214485138[ at ]microsoft.com...
> > Hi,
> > I am runing Office 2007.
> > Can't quite get ny head around your explanation.
> > My spreadsheet consists of columns A through to AI (the one in question,
> > with the longer text descriptions, is AH), and around 240 rows. It is row
> > 7,
> > column AH that is the first description which is affected...
> >
> > Matt
> >
> > "Walter Briscoe" wrote:
> >
> >> In message <1732D896-1D79-4320-B8D2-6758E399E9AE[ at ]microsoft.com> of Mon,
> >> 27 Oct 2008 04:03:02 in microsoft.public.word.mailmerge.fields, Matt
> >> Heason <Matt[ at ]Heason.?.microsoft.com.invalid> writes
> >> >Hi,
> >> >I am runing a basic mailmerge using an excel spreadsheet. one of the
> >> >mergefields has some instances that are over 43 words long. When this
> >> >happens
> >> >the merged field in the final document is truncated at 43 words. How do
> >> >I
> >> >control the length of the mergefield to allow all of the words to be
> >> >displayed?
> >>
> >> It might be a good thing to say what versions you are using.
> >> This is a well known problem. I decided to demonstrate it in Office
> >> 2003. I constructed an excel file with the following data:
> >> Name
> >> first
> >> second
> >> third
> >> fourth
> >> fifth
> >> sixth
> >> seventh
> >> eighth
> >> long field 12345678 2 2345678 3 ... 5678 a 2345 ... 5678 y 23456789z
> >>
> >> i.e. I had a column called name and I had a field consisting of about
> >> 350 characters after the eighth line. The field was truncated at 254
> >> characters in the merge output.
> >> The fix is to put a dummy field of 255 or more bytes in the first eight
> >> records. There is another fix which requires change of a registry datum
> >> to alter the number eight, but I take no notice of that because it
> >> affects all merges on a particular system.
> >>
> >> Basically, office has short and long string type and office uses the
> >> contents of the first eight excel rows to select between short and long
> >> strings. A short string can hold 255 bytes but one gets lost somewhere
> >> for technical reasons of which I care nothing - it is probable either a
> >> count byte or a zero terminator.
> >>
> >> To the astonishingly wonderful and patient MVPs who monitor this group:
> >> why is their not an FAQ for this group?
> >>
> >> I would have referred to the FAQ rather than constructing a problem
> >> demonstration and fix if an FAQ existed.
> >> --
> >> Walter Briscoe
> >>
>
>
Re: Ho do I control the length of a mergefield
Walter Briscoe <wbriscoe[ at ]nospam.demon.co.uk> 10/27/2008 3:54:49 PM
In message <120CB15E-7817-4A50-9A76-12BE19F707E6[ at ]microsoft.com> of Mon,
27 Oct 2008 08:10:13 in microsoft.public.word.mailmerge.fields, Matt
Heason <MattHeason[ at ]discussions.microsoft.com> writes
[Quoted Text]
>Fantastic! That solved it for me. Easy enough to discard the first record
>from the final merged document so an esy fix. A fairly basic issue though!

I am sorry my explanation did not sort things for you. I probably got my
limited understanding by reading <http://tips.pjmsn.me.uk/t0003.htm>
which is an awesome piece of work.

I agree the string type is limited to 255 characters rather than the 254
I suggested. (Off by one errors are traditional for programmers. ;)

I am glad the problem is resolved for you. It is a basic issue, but
probably the result of compromises Microsoft has to adopt with
conflicting requirements. ( You want it simple and fast? )
--
Walter Briscoe

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net