Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter
 
Posts: n/a
Default Autonew macro in Word to select specific record from Excel database

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


  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Autonew macro in Word to select specific record from Excel 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 that you
find there" at:

http://www.word.mvps.org/FAQs/InterD...DataFromDB.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/F...xFromXLDAO.htm

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


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

"Peter" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
That Bloke
 
Posts: n/a
Default Autonew macro in Word to select specific record from Excel database

Thanks, but is it the same for an Excel spreadsheet rather than an Access
database?

"Doug Robbins - Word MVP" wrote in message
...
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/InterD...DataFromDB.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/F...xFromXLDAO.htm

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


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

"Peter" wrote in message
...
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





  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Autonew macro in Word to select specific record from Excel database

Look at both of the articles and you will see that they use the same method.

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

"That Bloke" wrote in message
...
Thanks, but is it the same for an Excel spreadsheet rather than an Access
database?

"Doug Robbins - Word MVP" wrote in message
...
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/InterD...DataFromDB.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/F...xFromXLDAO.htm

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


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

"Peter" wrote in message
...
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







  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
That Bloke
 
Posts: n/a
Default Autonew macro in Word to select specific record from Excel database

Thanks, I'm sorted


"Doug Robbins - Word MVP" wrote in message
...
Look at both of the articles and you will see that they use the same
method.

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

"That Bloke" wrote in message
...
Thanks, but is it the same for an Excel spreadsheet rather than an Access
database?

"Doug Robbins - Word MVP" wrote in message
...
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/InterD...DataFromDB.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/F...xFromXLDAO.htm

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


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

"Peter" wrote in message
...
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









Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Word 97 in Windows XP to maintain formatting Charlie''s Word VBA questions Microsoft Word Help 22 May 20th 23 08:51 PM
Converting WordPerfect 12 files to Word 2003 Curious New Users 4 May 19th 23 02:48 PM
Why dont MS just f**king re-write Word from scratch? Its dogsh*t Word Hater Microsoft Word Help 33 May 5th 23 02:52 PM
glossary macro in Word? Tipuana Microsoft Word Help 7 June 10th 06 07:06 PM
Macro for Letter Settings Help Renee Cabets New Users 7 May 25th 06 10:50 PM


All times are GMT +1. The time now is 09:53 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"