Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Nikon Nikon is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using IF to find whether a Merge Field contains a substring Joshua Pangborn Mailmerge 12 May 11th 23 02:51 AM
Replace/Erase substring of a word Julian Microsoft Word Help 9 February 21st 06 03:22 PM
Name fields in mailmerge oe Mailmerge 1 November 16th 05 07:04 PM
is there a substring function in word merge Dan Microsoft Word Help 2 June 25th 05 05:10 PM
Using MAILMERGE fields within HYPERLINK fields for Merge to Email Mark V Mailmerge 2 December 4th 04 04:01 PM


All times are GMT +1. The time now is 04:40 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"