• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 175
  • Last Modified:

splitting mailmerge results

i want to mailmerge data into a word 97 document but i want to split the data.
For example i have a field contaning street name and number but i want to split them during the merge.
highstreet 5 as to become separate highstreet and 5.
can annyone help me with this one.

  • 3
1 Solution
I've written a little program to do this AFTER the merge, and it splits the merge document into seperate files.

What you want to do is included some special tag at the top and bottom of the Merge document. My situation is for HTML files so my merge doc looks like this:

all the data i need
is here

After I mail merge and save the doc, my VB program reads the Merge doc with Line input and breaks it up at the <!-- --> tags

When it writes the seperate files out , it uses <<event>> for the filename.

I have a PAQ here on this. I'll try to find it and post the number of it or can post some code later when I have more time.

My PAQ is number Q.10213988
It was back on October 2 and it's titled:
"simple task but I'm I newbie"

There are good suggestions and code that I used to get this working.

Good Luck.
Oh wait, I just reread your question and realized your looking to do something different than what I proposed here, but really what I'm doing could be modified to accomplish your task. It would take little more work, but the principle is the same.
You will have to do some pre processing on your data source file. I am affraid, there isn't a straight forward function.
I had to do similar sort of magic creating sallary review letters in our company.

Try this (You can do it in VBA or Manually):
Open your data source document (Make sure your Main Document is not open while you do this). Select all. Table / Convert table to text. Make sure your delimiter is TAB. Say your Address1 field has "19 Torrington Road" and you want Address1 field to be split up in Address1(numeric part), Address2(character part).
Find the "Address1" string in the first line of text (Field Headers) and insert TAB & "Address2". That is you create a new merge field.
Go to the next line and only add a TAB between the numeric part and the character part of Address1 (this will split Address1 into two data fields). Data fields are separated with TABs so you can count TAB characters in a single line to get to Address1 data.
You do not have to Convert text to table. Mailmerge recognises TAB delimited format.
Now open your Main Document and you will find that Address2 is a valid field you can select.

Take care.

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now