msword mail merge formula

I know how to make a mail merge using vb.net with msword my problem is this.. I need to read in a text file take the info from column 2 and change it and then put it into the mailmerge as a different name then what it was called in the datafile.  So how do you read in data from a file change 1 column of data to something else then put into a document as a different name than what it was called in the datafile???
ConnexusDaveAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

GrahamSkanRetiredCommented:
It isn't clear whether you want to change the name of the field (column), or to change the actual text as it is put into the document.

In ether case, it might be easiest to modify the input document.

For changing the field name, the most obvious thing to do would be to use the same names in the MERGEFIELDs as the column headers.

If this cannot be done some reason, you could have separate header file.

To change the text at the merge time is rather more difficult, and depends on what you want to change it into. You could choose to look for particular incoming text and change that with an IF field. Like this:

{ IF { MERGEFIELD myfield1 } = "some text" "new text"  { MERGEFIELD myfield1 } )
0
ConnexusDaveAuthor Commented:
one field is the full name (first, middle and last.). I only want the first name from this mergefield
second field is a date that I need to add 10 days to..

0
GrahamSkanRetiredCommented:
Unfortunately there isn't a 'substring' function in Word fields. Also Date arithmetic is not impossible but is very difficult.

It would be fairly simple in VB or VBA to create a new input file from the original with the firld as you require them.

strFirstName = Split(strFullname, " ")(0)

newdate = Dateadd("d", 10, olddate)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ConnexusDaveAuthor Commented:
Thanks much
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Word

From novice to tech pro — start learning today.