 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Tim Guest
|
Posted: Mon Aug 14, 2006 2:49 pm Post subject: Word mail merging |
|
|
Using some code such as
var
wrdDoc: Variant;
begin
wrdDoc.MailMerge.CreateDataSource('MergeData.doc',,,'Field1,Field2,
etc..
I can create a data source into which I can add data.
However, there seems to be a limit of 255 characters to the parameters in
the CreateDataSource method. I can reduce the length of each field name to
try and keep within the 255, but then the names become less intuitive for a
user. This is not a critical problem, but is there any way to do this
without being limited to 255 characters?
Thanks. |
|
| Back to top |
|
 |
Oliver Townshend Guest
|
Posted: Thu Aug 17, 2006 2:12 am Post subject: Re: Word mail merging |
|
|
| Quote: | However, there seems to be a limit of 255 characters to the parameters in
the CreateDataSource method. I can reduce the length of each field name to
try and keep within the 255, but then the names become less intuitive for
a
user. This is not a critical problem, but is there any way to do this
without being limited to 255 characters?
|
What sort of data source are you creating? Are you populating each record
using it? Normally I'd reference a .csv file as the data source personally,
which would get around the length problem. But I don't think I've ever had
a field name longer than 20 characters.
Oliver Townshend |
|
| Back to top |
|
 |
Tim Guest
|
Posted: Mon Aug 21, 2006 5:09 pm Post subject: Re: Word mail merging |
|
|
"Oliver Townshend" <oliveratzipdotcomdotau> wrote in message
news:44e38a5c$1 (AT) newsgroups (DOT) borland.com...
| Quote: | However, there seems to be a limit of 255 characters to the parameters
in
the CreateDataSource method. I can reduce the length of each field name
to
try and keep within the 255, but then the names become less intuitive
for
a
user. This is not a critical problem, but is there any way to do this
without being limited to 255 characters?
What sort of data source are you creating? Are you populating each record
using it? Normally I'd reference a .csv file as the data source
personally,
which would get around the length problem. But I don't think I've ever
had
a field name longer than 20 characters.
|
Oliver,
Using the MailMerge.CreateDataSource method for a suitable OleObject, you
create a Word data source with the required fields, into which you can add
your records. This ends up with a standard Word mail merge document to use
as the source for your mail merge document.
However, as well as the name of the file, CreateDataSource takes all the
field names as paramenters, eg
CreateDataSource('datasource.doc',,,'field1','field2',...) and it is this
set of parameters that is limited to 255 characters in total.
As you say, creating a csv would certainly solve the problem, although the
CreateDataSource method is quite a simple way of doing it assuming your
field list is not too long.
Thanks. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|