Creating MailMerge Dat file from Access VBA

R

Rob Monroe

I am attempting to create a MSWord Mail Merge Data file from an access
database through VBA. I am operating through Office 2000.

The VBA line is somewhat like this:
DoCmd.TransferText acExportMerge, , "Name of Query", "Name of DAT file to be
created"

However whenever I try the code I get the following error:
Run-time error '3027':
Cannot update. Database or object is read-only.

I do not know what is causing this error nor how to correct it.

Rob Monroe
 
C

Craig

I would use automation with Word from Access.

First you need to create the Word doc and incorporate the
mail merge via choosing a table or query from the database
and put the Word merge fields where you want them. If you
press the <<>> button you will be able to see the data in
the word document.

Then you need to code it to automatically do it.
Example:
Dim myword as Word.Application
And from there use Words object model to activate the
document and use the merge method for the document.

Hope this helps.
--Craig
-----Original Message-----
I am attempting to create a MSWord Mail Merge Data file from an access
database through VBA. I am operating through Office 2000.

The VBA line is somewhat like this:
DoCmd.TransferText acExportMerge, , "Name of
Query", "Name of DAT file to be
 

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