Referencing a library programically.

H

Hellfeld

Hi. I have office 2000. I wanted to reference the DAO 3.6 library in word
programically. How would I go about doing this?

My problem occurs when I use the organize feature to move modules, a form,
and a class module from a template to a document that wasn't based on that
template.

Then, when I go to compile the project in the document I get the error "user
defined type not defined" until I add the DAO library.

Any help would be much appreciated.
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?SGVsbGZlbGQ=?=,
I have office 2000. I wanted to reference the DAO 3.6 library in word
programically. How would I go about doing this?

My problem occurs when I use the organize feature to move modules, a form,
and a class module from a template to a document that wasn't based on that
template.

Then, when I go to compile the project in the document I get the error "user
defined type not defined" until I add the DAO library.
Type ActiveDocument.VBProject.References.AddFromGuid in a VBA module, then
press F1 to open the Help.

You can find out the GUID by setting a reference then running the following

Sub LoopRefs()
Dim ref As Reference

For Each ref In ActiveDocument.VBProject.References
Debug.Print ref.FullPath, ref.GUID
Next
End Sub


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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