Office Automation - starting Word from Access

K

Ken Shelson

I'm trying to do a mail-merge from Access, but with Word running on a
separate server (using dcomcnfg to cause Word to be started remotely).
I can start the Word remotely in server mode using the following
code:

Dim wobj As Word.Application
Set wobj = CreateObject ("Word.Application")

but I can't connect to a running object using the GetObject method:

Set wobj = GetObject(, "Word.Application")

It returns error 429. Has anyone seen something like this previously?

Thanks in advance,

Ken
 
M

martinique

You're confusing two methods.

Either (early-binding) add the Word library as a reference to your VBA
project, then use:

Dim wobj as Word.Application
Set wobj = new Word.Application

or (late-binding) don't add the Word library and use

Set wobj = CreateObject("Word.Application")
 

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