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 / July 2006

Tip: Looking for answers? Try searching our database.

VBA Referencing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark - 31 Jul 2006 18:38 GMT
reI have a template which I keep a lot of code in which is referenced to by
quite a number of other templates.  I want to move the template which is
referenced to another location on my computer, this will obviously affect the
reference link.  it is possible with code to alter all my templates so that I
don't have to open them myself one by one and change the reference path?

If so, would someone by kind enough to assist me with some code, please?

Thanks

Signature

Mark

Jonathan West - 31 Jul 2006 19:02 GMT
> reI have a template which I keep a lot of code in which is referenced to
> by
[quoted text clipped - 6 lines]
>
> If so, would someone by kind enough to assist me with some code, please?

The relevant item is the References collection of the VBProject object. You
need to identify the correct item in that collection. Then you need to
Remove that item, and then use the AddFromFile method to add a new reference
to the collection.

You will need to cycle through each of your templates in order to do that.
Work out the exact code necessary to do that once, and then put the relevant
code into the middle of the code sample in this article

Find & ReplaceAll on a batch of documents in the same folder
http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

 
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.