Changing Object Library References

B

Bo Hansson

I've made a small application in Word 2k VBA that is supposed to run even in
XP environments. My problem is that I have a reference to the Outlook9
object library, and this stops the application from running in XP. When
launching the application in XP, I therefore want to replace that reference
in code.

How do I do that?

/BosseH
 
J

Jezebel

Use late binding. Instead of adding the reference to the project as such,
use:

CreateObject("Outlook.Application")

Then your app picks up whatever version of Outlook is available.
 
B

Bo Hansson

Thanks,

In fact I, use late binding, but had also added the reference to the project
as such.


/BosseH
 
J

Jonathan West

Bo Hansson said:
Thanks,

In fact I, use late binding, but had also added the reference to the project
as such.

Then simply remove the reference. If your late-bound code is working right,
all should then be well.

Test it thoroughly on all versions that it has to run under.
 

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