Exporting Data from MS Word to MS Access db

  • Thread starter Thread starter Nam
  • Start date Start date
N

Nam

I am developing an MS Word 200 Add-In that requires collecting certain
sentences from MS Word document and storing it into MS Access 2000. I would
like to achieve this task without worrying about installing (or registering)
DAO or ADO etc on the client’s machine. Does MS office have a built-in data
migration functionality that I can use in my VBA macros?

Thanks in Advance,
Nam
 
Hi Nam:

There is no such beast in MS Word VBA. You have to use DAO or ADO. What I do
is to do an Installshield setup to install the various dlls into their
appropriate places in the new host computers. This gets tedious, though, as
you need to get the dlls for MS Access 2000/2002/2003 and now the 2007
versions.

Cheers,
Al
 
Thank you Alborg for your response. I was thinking MS may have something like
MSQuery that I could use to achieve this task.

Nam
 
Hi Nam,

Assuming Access isn't installed on the client machine, take a look at XML -
might be a good alternative for you. Another alternative would be to create
your own csv file format - append the Word doc sentences to that csv file
along with a timestamp, maybe the full doc name, and some sort of key
column - maybe a roll-your-own autonumber. You could link to that csv from
Access and update whatever tables as appropriate querying the data from that
record source. This isn't as complicated as it sounds - if you are far
enough into VBA to create Add-Ins for clients, then you can probably handle
the file management code.

If Access is installed on the client machine then you can use the Access
Application object to open the database, insert your data where you wish,
and close the database from VBA code running in Word.

Hope this helps,
Gordon
 
Back
Top