Programmatically add COM reference?

A

AP

Hi,

IS there a way to add a reference to a COM library in a word template file
in code? The reason I ask is because our application uses a template file
that references a COM library that we have built. But, depending on where
the COM library is installed (which can change depending on where the user
chooses to install our application), it seems as though the word template
can only reference this library if it's in the same location. Any other
suggestions for accomplishing this would be appreciated as well.

Thanks,

Adam
 
W

Word Heretic

G'day "AP" <[email protected]>,

actdoc.vbproject.references.add

Steve Hudson
Word Heretic Sydney Australia
Tricky stuff with Word or words

Email: WordHeretic at tpg.com.au


AP was spinning this yarn:
 
T

Tom Winter

Word Heretic said:
G'day "AP" <[email protected]>,

actdoc.vbproject.references.add

Steve Hudson
Word Heretic Sydney Australia
Tricky stuff with Word or words

Email: WordHeretic at tpg.com.au


AP was spinning this yarn:

You should be able to add a reference based on a GUID. (I believe it's
..References.AddFromGUID(), though I don't have the help file open right
now!) That will register it no matter where the COM component is installed,
as long as the COM component has been registered on the user's system. I use
this to add a reference to my COM component.

-Tom
 

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