control excel through word

J

jsbibra

ok my database is in excel2007 and has to be merged to word2007--i am
familiar with mailmerge
how can i automate selection of a field (in excel) by pressing a button(or
macro) on the word document
example
when i press the button or run macro in word the following actions are
completed in one go
--a field in excel is selected(say COUNTRY)
--then in that field a particular sub-field is selected(SAY JAMAICA)
--the merge is completed in word docu
--blank rows in the word document get deleted
--the word print command pops up
similarly if i press another button or run another macro
i can select any other country say iran or india
or--another idea is that a list box popsup with all the names available
under the country field and i simply select a country and the sequence of
merge and print starts
 
D

Doug Robbins - Word MVP

Do you have Access. It would be far simpler if you set up a proper
relational database in Access.

However, see the article "Control Excel from Word" at:

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

As most of the other code that you will need will be using the Excel object
model, if you need help with that, you would be best asking in the
microsoft.public.excel.programming newsgroup.

--
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
 

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