Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / June 2006

Tip: Looking for answers? Try searching our database.

Autonew macro in Word to select specific record from Excel database

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter - 11 Jun 2006 16:30 GMT
Hi,
I'm trying to automate a procedure where a document based on a specific
template, asks for a value from a specific field in a database so that only
that record will be merged into the document based on that template.  I'm
using Office 2003 but would prefer it to work in Office 2002 as well.

Basically, the spreadsheet is the data for a mailmerge document and I'm
using the InputBox function to retrieve the record that matches the search
string (which can only be a 5-digit number) from the "IDCode" field in
"Database.xls" in the "C:\Database" folder.  I have a number of other fields
within the template that are populated from the database.

TIA,

Pete
Doug Robbins - Word MVP - 11 Jun 2006 18:59 GMT
If this is something that is done regularly, you can apply the method in the
article "Access a database and insert into a Word document the data that you
find there" at:

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

to obtain information from a named nange in Excel as shown in the article
"Load a ListBox form a Named Range in Excel using DAO" at:

http://word.mvps.org/FAQs/InterDev/FillListBoxFromXLDAO.htm

Probably better to use { DOCVARIABLE } fields in the document rather than
mergefields and create document variables that have the values retrieved
from Excel.

Signature

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

> Hi,
> I'm trying to automate a procedure where a document based on a specific
[quoted text clipped - 13 lines]
>
> Pete
That Bloke - 12 Jun 2006 18:50 GMT
Thanks, but is it the same for an Excel spreadsheet rather than an Access
database?

> If this is something that is done regularly, you can apply the method in
> the article "Access a database and insert into a Word document the data
[quoted text clipped - 29 lines]
>>
>> Pete
Doug Robbins - Word MVP - 13 Jun 2006 04:52 GMT
Look at both of the articles and you will see that they use the same method.

Signature

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

> Thanks, but is it the same for an Excel spreadsheet rather than an Access
> database?
[quoted text clipped - 33 lines]
>>>
>>> Pete
That Bloke - 14 Jun 2006 17:39 GMT
Thanks, I'm sorted

> Look at both of the articles and you will see that they use the same
> method.
[quoted text clipped - 36 lines]
>>>>
>>>> Pete
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.