Importing Data from Word Form

  • Thread starter Thread starter Rose B
  • Start date Start date
R

Rose B

I am about to try and create a 'utility' that will take information entered
on Word form(s) (saved in a given directory) and load them into Access tables
based upon the field names in the Word form. Before I embark upon this I
wondered if anyone out there has done something similar that could be used as
a base from which to clone?
 
I am about to try and create a 'utility' that will take information entered
on Word form(s) (saved in a given directory) and load them into Access tables
based upon the field names in the Word form. Before I embark upon this I
wondered if anyone out there has done something similar that could be used as
a base from which to clone?

Something like this?
http://www.computorcompanion.com/LPMArticle.asp?ID=136

Either that or you can create an instance of Word, use DIR to loop
through the directory specified by the user (using the BrowseFolder
API, maybe), and then add a new record to your recordset, loop through
the bookmarks in the Word doc, assigning them to the corresponding
fields in your recordset, update your recordset, close the word doc
and go to the next one. When you're done, close the instance of Word
and your recordset object.

Some useful bits:
BrowseFolder API: http://www.mvps.org/access/API - should be near the
top.

fIsAppRunning: same place... I think it's in one of the Excel
automation routines. Just use
fIsAppRunning("word")...

dig around the NG for a good example of using DIR to loop over
directories. There should be several.

and remember to close everything you open. AND close them in your
error-trapping code or you could end up with a zillion copies of Word
running on your computer without realizing it.
 
I am about to try and create a 'utility' that will take information entered
on Word form(s) (saved in a given directory) and load them into Access tables
based upon the field names in the Word form. Before I embark upon this I
wondered if anyone out there has done something similar that could be used as
a base from which to clone?

Something like this?
http://www.computorcompanion.com/LPMArticle.asp?ID=136

Either that or you can create an instance of Word, use DIR to loop
through the directory specified by the user (using the BrowseFolder
API, maybe), and then add a new record to your recordset, loop through
the bookmarks in the Word doc, assigning them to the corresponding
fields in your recordset, update your recordset, close the word doc
and go to the next one. When you're done, close the instance of Word
and your recordset object.

Some useful bits:
BrowseFolder API: http://www.mvps.org/access/API - should be near the
top.

fIsAppRunning: same place... I think it's in one of the Excel
automation routines. Just use
fIsAppRunning("word")...

dig around the NG for a good example of using DIR to loop over
directories. There should be several.

and remember to close everything you open. AND close them in your
error-trapping code or you could end up with a zillion copies of Word
running on your computer without realizing it.
 
Back
Top