Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Referencing a library programically.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Hellfeld - 11 Jan 2006 21:36 GMT
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.  
Cindy M  -WordMVP- - 12 Jan 2006 10:15 GMT
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?  
[quoted text clipped - 5 lines]
> 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 :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.