Use Mail Merge to Identify a Specific Record and ‘Mail Merge’ it

R

ryguy7272

I am trying to use VBA to look for, and identify, a specific record and
complete the mail merge. I record a macro that does the mail merge for me,
but it doesn’t allow a user to input an ID number into the word doc. and
thereafter import the appropriate contact information for the letter. For
instance, if I enter 345, and run the macro, I would like the ‘mail merge’
tool to find the information that corresponds to this ID number. Ideally, I
would like the individual, the address, and the other contact information
relevant to that individual, to be imported once I enter the ID number and
run the macro. Can this be done? Can someone describe how to do it?

Regards,
Ryan---
 
R

Russ

Could you record a macro while using Tools/Data Merge Manager to query for
ID Number 345?
If you can, then, wherever you see the Number "345" in the recorded macro,
you could substitute a variable set up to get and store the ID number from a
user.
Use an inputbox(See Word VBA Help) to get the number from the user.
 
D

Doug Robbins - Word MVP

Mail merge is probably not the best solution. What is the data source? Is
it always the same ID number that you want to merge or do you want the user
to be able to:

1. Enter the ID Number, or

2. Select an ID Number from a list of all of the ID numbers in the
datasource?

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
R

ryguy7272

This is Excellent! You've both given me some ideas to run with. I'm still
undecided about the best way to do this though. Let me take a step back for
a moment.

I stumbled across this URL last week:
http://office.microsoft.com/en-us/help/HA011161241033.aspx

This is quite a nugget of information. I followed the recommended steps and
created a customized Toolbar with some preformatted form letters. I have
eight letters now and may add a few more. These form letters load up fine,
with both Word and Outlook. I’m trying to figure out if there is a way to
insert a letter into an email and then pull up the correct contact
information that corresponds to a certain unique ID. For example, ID# 1200,
may correspond to Bill Smith. I wanted to be able to load the form letter
into the body of my email, type on the ID number of a specific contact, and
get word to populate the name, address, etc. for the specific contact that
matches that specific ID number. Then I can just click send and the email
shoots off to the recipient. Any thoughts on this?

Regards,
Ryan---
 
R

ryguy7272

Oh, and just so you know, I am using Excel as the data source. This is set
up and it works great for Mail Merge, but I think what I want to do now is a
little different from Mail Merge...that's what I'm trying to determine now.
Is Mail Merge the best way to accomplish what I want to accomplish or is
there a better way of doing this. Any suggestions, recommendations, etc.
would be greatly appreciated.

Regards,
Ryan---
 
D

Doug Robbins - Word MVP

As mentioned in my initial response, I do not consider that mail merge is
the best method, nor do I like interfacing Word with Excel. I much prefer
to work with Word and Access.

That said, you may find some ideas in the following articles:

"Control Excel from Word" at:

http://www.word.mvps.org/FAQs/InterDev/ControlXLFromWord.htm

"Control Word from Excel" at:

http://www.word.mvps.org/FAQs/InterDev/ControlWordFromXL.htm

"Early vs. Late Binding" at:

http://www.word.mvps.org/FAQs/InterDev/EarlyvsLateBinding.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
R

ryguy7272

Thanks a lot Doug!! This is very useful. I need to research this further.
It may, or may not, be the direction I want to go with this.
 

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