HOW DO I ASSIGN A MERGEFIELD DATA RESULT DIRECTLY INTO A VARIABLE.

  • Thread starter Alan, the Australian Optometrist
  • Start date
A

Alan, the Australian Optometrist

I am trying to get Word to extract data from my clinical database (.DBF
format) so I can produce personalised (referral) letters for clients.

I can extract the data into my letter template using a mailmerge feature
involving {MERGEFIELD fieldname} but would then like to assign the result to
a variable for use in a macro so I can manipulate the data and get the macro
to run on opening the template.

For example
- my database contains my patient's date of birth
- {MAILMERGE birthdate} returns 08-09-1958 as text
- I need to manipulate this data to convert the date of birth to an age
value to include in the referral letter.
- I was planning on doing this via an autostart macro but need to get the
macro to recognise the result of {MAILMERGE birthdate} as a variable unless
there is a better way of achieving the same result.

Any HELP / suggestions gratefully received
 
M

macropod

Hello Alan, the Australian Optometrist,

You don't need a macro to calculate someone's age. To see how you can do
this, and more than you ever thought you might want to do with dates & times
using Word fields, check out:
http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=wrd&Number=365442
(url all one line)

Using the field approach, you can plug the mailmerge birthdate straight into
the field.

Cheers

"Alan, the Australian Optometrist" <Alan, the Australian
(e-mail address removed)> wrote in message
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top