programmatically add references (1 Viewer)

mazza

Registered User.
Local time
Yesterday, 19:21
Joined
Feb 9, 2005
Messages
101
I distrubute an application created in Access 2003 however it is distributed with Access Runtime. One of the output functions is to write data to MS word templates.
I only have Word 2003, hwr many of my users still have office 97 or 2000.
In my references I can only add Microsoft word 11.0 object library, but users with the older word versions cannot reference this.
As users cannot enter the visual basic module (as it is either blocked or they don't have access 2003)
Could I add older word references programatically if the have older word versions and if so I would I go about it?
 

DJkarl

Registered User.
Local time
Yesterday, 21:21
Joined
Mar 16, 2007
Messages
1,028
I distrubute an application created in Access 2003 however it is distributed with Access Runtime. One of the output functions is to write data to MS word templates.
I only have Word 2003, hwr many of my users still have office 97 or 2000.
In my references I can only add Microsoft word 11.0 object library, but users with the older word versions cannot reference this.
As users cannot enter the visual basic module (as it is either blocked or they don't have access 2003)
Could I add older word references programatically if the have older word versions and if so I would I go about it?

You can use this to add references, the FileName is the path and name of the file to add as a reference.

Code:
Application.References.AddFromFile FileName

A better option might be to do away with the references that are causing you problems, in this case Word.

You can declare your word object as a generic object and then use the CreateObject method.

So this

Code:
Dim WordApp as Word.Application
Set WordApp = New Word.Application

Would become

Code:
Dim WordApp as Object
Set WordApp = CreateObject("Word.Application")

I'm not generally a fan of this method as you lose the intellisense features, but if your program is already written this might be the way to go.
 

mazza

Registered User.
Local time
Yesterday, 19:21
Joined
Feb 9, 2005
Messages
101
thanks

will give it a go
 

bondowen

New member
Local time
Yesterday, 19:21
Joined
Sep 6, 2007
Messages
1
Thanks a bunch.
It realyl worked for me like a charm.
U are the man.
 

Users who are viewing this thread

Top Bottom