Reply
 
Thread Tools Display Modes
  #1   Report Post  
Cameron Sutherland
 
Posts: n/a
Default Copying references from template to documents

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.AddFrom File
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
  #2   Report Post  
Shauna Kelly
 
Posts: n/a
Default

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


"Cameron Sutherland" wrote in message
...
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.AddFrom File
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



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
We have word documents referencing a template on a dead server ho. D K Joynts Microsoft Word Help 1 April 23rd 05 09:30 AM
Applying Styles from one template to existing documents Cory Levine Microsoft Word Help 1 April 12th 05 05:41 PM
VBA to Copy Template styles to many documents...is this OK? Barry Millman Microsoft Word Help 1 January 18th 05 11:06 AM
save and send document without sending template references andrew Microsoft Word Help 2 January 13th 05 10:49 PM
Copying a letter header into a mailmerge template dixie Mailmerge 4 December 20th 04 09:17 AM


All times are GMT +1. The time now is 08:28 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"