Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Substring used one Mailmerge Fields
In this office we have documents that take .dat files created from our Oracle
database, and use them for mail merge documents. Recently the size of the fields has been increased and the merge documents don't fit some of the fields anymore. I am wondering if there is any way, macro or otherwise, that I can substring (shorten) the merge field so it still fits it's document. Essentially what I would like to do is, figure out if a field is over a certain length and if it is, cut it to a specified length. Eg. 25 characters. |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
Substring used one Mailmerge Fields
The simplest approach is to get your database people to do that in an Oracle
View, or in whatever tool is used to generate the .dat. Every other approach is much more complicated. There's no simple field that lets you do, e.g. { =left({ MERGEFIELD x },25) } If that cannot be done, you can consider... a. using Word VBA, the OpenDataSource method, and an Oracle SQL query to get your data directly from Oracle. But you are limited to either 255 or 511 characters in the query (it depends) - that gets used up pretty quickly even if the underlying query is very simple b. depending on how Word connects to your .dat file, you /may/ be able to use the same technique as in (a), but using Jet SQL instead of Oracle SQL. Similar constraints as in (a) apply. c. using Word VBA and MailMerge events to truncate each field before each record is merged d. preprocessing your .dat in some way to reduce the appropriate field lengths. Peter Jamieson "Nikon" wrote in message ... In this office we have documents that take .dat files created from our Oracle database, and use them for mail merge documents. Recently the size of the fields has been increased and the merge documents don't fit some of the fields anymore. I am wondering if there is any way, macro or otherwise, that I can substring (shorten) the merge field so it still fits it's document. Essentially what I would like to do is, figure out if a field is over a certain length and if it is, cut it to a specified length. Eg. 25 characters. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using IF to find whether a Merge Field contains a substring | Mailmerge | |||
Replace/Erase substring of a word | Microsoft Word Help | |||
Name fields in mailmerge | Mailmerge | |||
is there a substring function in word merge | Microsoft Word Help | |||
Using MAILMERGE fields within HYPERLINK fields for Merge to Email | Mailmerge |