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 / Long Documents / May 2005

Tip: Looking for answers? Try searching our database.

Copying references from template to documents

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cameron Sutherland - 02 May 2005 16:10 GMT
I have a template with code that needs to connect to a
database (ADO) and to do this I need to add the object
library reference. The problem I'm faced with is in the
documents that are created from this tempalte are going to
be severed from the template so I copy all the code to
them locally except I can't figure out how to get the
reference to be copied over to the documents. I tried to
do it in code :
Application.VBE.ActiveVBProject.References.AddFromFile
strPath
but with some Microsoft security patch I get this
message: "Programmic Access to Visual Basic Project is not
trusted"
Is there some way to tell Word to copy references when it
creates the documents from the template?
-Cameron Sutherland
Shauna Kelly - 03 May 2005 15:00 GMT
Hi Cameron

Try Tools > Options > Security. Click Macro Security. On the Trusted
Publishers tab, tick "Trust access to Visual Basic Project".

If you have follow-up questions, I suggest you post to one of the Word VBA
newsgroups, such as microsoft.public.word.vba.general.

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

>I have a template with code that needs to connect to a
> database (ADO) and to do this I need to add the object
[quoted text clipped - 12 lines]
> creates the documents from the template?
> -Cameron Sutherland
 
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.