View Single Post
  #3   Report Post  
bilisa
 
Posts: n/a
Default

Thank you for your effort, but im dealing with users who need to mailmerge
directly with the txtfile in question, because they are novice users who
recently started using MS Word and because the advantage of using vba to
automize the routine would be lost if they had to go through so many steps to
execute a mailmerge. One way to do it is to open the textfile with Excel,
copy the data into an Excel sheet and merge with it which works fine, but
even though this solves the problem I still think it would be too difficult
for my users because of their low IT level. I still think its possible to do
it directly with vba because im converting templates from WordPerfect to Word
and it works in WordPerfect. Any suggestions are welcome..

"Peter Jamieson" wrote:

I can't think of a way to do it directly - you will need to use code to
transform the data into something that Word can use. In this case, you
really need to know the structure. Doing it in code would take some effort,
but it would not be all that hard to do it by hand as long as the file is
not huge, e.g. if I make a few guesses about the format,
a. open the file in Word
b. remove the "header", including the heading labels and everything else
down to the first piece of data ("12321323434").
c. use Edit Replace to
- replace ^p1,0 by ^t
- replace ^p-1,0^pBOT^p1,0 by ^p
d. you should now have one row per record and a tab between each field.
e. optionally, use Table|Convert text to table to convert the data to a
Word table
f. add your header row (in table format if you did (e)
g. save the file as a Word .doc
h. use that as the data source.

Peter Jamieson
"bilisa" wrote in message
...
Any suggestions how to execute a a direct mailmerge with the following
data
from a textfile?

TABLE
0,1
""
VECTORS
0,6
""
TUPLES
0,10000
""
LABEL
1,0
"MDLNR"
LABEL
2,0
"NAVN"
LABEL
3,0
"ADRESSE1"
LABEL
4,0
"ADRESSE2"
LABEL
5,0
"POSTNR"
LABEL
6,0
"BYEN"
DATA
0,0
""
-1,0
BOT
1,0
"12321323434"
1,0
"some name"
1,0
""
1,0
"some road"
1,0
"some zipcode"
1,0
"some city"
-1,0
BOT
1,0
"123213213"
1,0
"some name"
1,0
""
1,0
"some address"
1,0
"some zipcode"
1,0
"some city"
-1,0
BOT
1,0