Hello,

I am merging documents with fields from an Excel sheet.
I need to put some text (from Excel) into boxes pre-printed on the paper,
the boxes have fixed sizes.

The problem is that some datas in the Excel sheet doesn't fit in the boxes,
and because I am using non-fixed fonts the values of the datas are changing
the width of the text (MMMMM vs IIIII).

My goal is to do a macro (in Excel or Word) to tell me which records doesn't
fit in a XX centimeters box when using a specific font/size (and then I can
modify manually the datas in Excel when it's too large).

I searched how to get the real printed width (or any value with a fixed
ratio value/real_printed_width) of a string but I can't find any information
about it.

Thank you VERY VERY much in advance, ANY help is REALLY appreciated.
Seb.

PS: sorry for my bad English, it is not my first language.

Re: String width in specified font/size when merging by Seb

Seb
Sun Oct 24 08:06:38 CDT 2004

I remarqued something very strange.

In Word (2000 & 2003) the "I" line is greater than the "M" line when viewing
and printing.
In Excel when viewing the "M" line is greater but when printing the "I" line
is greater like in Word !!!

Buggy Excel :)

"Seb" <NOSPAM@seb@poussin.be> a écrit dans le message de news:
%23vfvzdWuEHA.2000@TK2MSFTNGP14.phx.gbl...
> Hello,
>
> I am merging documents with fields from an Excel sheet.
> I need to put some text (from Excel) into boxes pre-printed on the paper,
> the boxes have fixed sizes.
>
> The problem is that some datas in the Excel sheet doesn't fit in the
> boxes, and because I am using non-fixed fonts the values of the datas are
> changing the width of the text (MMMMM vs IIIII).
>
> My goal is to do a macro (in Excel or Word) to tell me which records
> doesn't fit in a XX centimeters box when using a specific font/size (and
> then I can modify manually the datas in Excel when it's too large).
>
> I searched how to get the real printed width (or any value with a fixed
> ratio value/real_printed_width) of a string but I can't find any
> information about it.
>
> Thank you VERY VERY much in advance, ANY help is REALLY appreciated.
> Seb.
>
> PS: sorry for my bad English, it is not my first language.
>