+ Reply to Thread
Results 1 to 1 of 1

Thread: What is code for adding Extensibility 5.3 reference library to a Word Document?

  1. #1
    Forum Contributor sauerj's Avatar
    Join Date
    11-11-2009
    Location
    Lafayette, IN
    MS-Off Ver
    Excel 2003
    Posts
    116

    Smile What is code for adding Extensibility 5.3 reference library to a Word Document?

    FORGET THIS POST: The code below DOES WORK after all!!!
    I just had a jump-around, and it wasn't executing; didn't realize it until doing a better job of debugging the code. Sorry for the stupidity!!!!!

    NOTE: This is for WORD 2003!!!
    1)
    I am trying to programmically add the Microsoft Visual Basic for Applications Extensibility 5.3 reference library to a Word Document. I put the following code in the Document_Open Event procedure, but it does NOT add the reference. It doesn't error; but doesn't add the reference.
    2) I want to do this programmically because I want to develop an automated (VBA) means to copy multiple modules from a SOURCE document to many TARGET documents (to be used by future users when modules are revised). And, want these VBProject objects to be automatically available without requiring others to manually add this reference.
    3) I got this code from multiple internet sites, but it was for Excel, not Word. The only difference is that instead of "ActiveDocument", this text was "ThisWorkbook". Other than that, if it works for Excel, then with this object name change, it ought to work for Word. Any ideas why this code doesn't work in Word?
     ActiveDocument.VBProject.References.AddFromGuid GUID:= _
      "{0002E157-0000-0000-C000-000000000046}", Major:=5, Minor:=3
    Last edited by sauerj; 02-07-2011 at 10:05 PM. Reason: Idiot Mistake: Dropping Thread Request

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0