Field Changing Macro

J

jay

Someone gave me a macro named ResetLinkPath for use in resetting hyperlinks.
Now I need to use the macro and have little to go on. Text reads:
--------------------------------------------------------------
\Word Field External Link Updater

This document has a macro (ResetLinkPath – with various supporting
functions) for updating external field links in the active document. The
macro works with any of the following fields:
• HYPERLINK;
• INCLUDETEXT;
• INCLUDEPICTURE;
• LINK; and
• RD,
one of which you will be asked to select, and provides four options for the
mode of operation:
• Option 1: Resets all links to the same folder as the active document. This
is only necessary while the links are being updated. You could use this
option if the target document is presently in same folder as the source
file(s), since it eliminates the prompt to select the path to the source.
• Option 2: Resets all links to a single folder chosen by you. You could use
this option if there is only one source file, or if there are multiple source
files that are all in a common folder other than the folder in which the
target document is located.
• Option 3: Resets the links to each folder to another folder chosen by you.
You could use this option if there are multiple source files that were
previously kept in a common set of folders, but the each set of source files
that were previously kept in the one folder are still kept in common, though
different, sets of folders.
• Option 4: Resets the links to each source file to a folder chosen by you.
You could use this option if there are multiple source files, but their
folder arrangements are now different to what they were when the links were
created (or last updated).

You will also be prompted to select which of the above options to use.

Notes:
To use this utility, put it in either the startup folder, or in the
templates folder to be loaded as an add-in.
Source filenames are expected to have a 3-letter extension (eg
filename.ext). If they do not, the macro will not work correctly.
By running the macro, all fields of the specified type in the active
document will be updated to the nominated folders.
Option 1 is only available if the target document has been saved – you can’t
use it on a new unsaved document, because Word doesn’t have a ‘home’ folder
for the document to use for updating the links.
In Options 2 – 4, you will be asked to select the source folder(s). If you
cancel out of the folder browser, the affected link(s) will be updated
without any folder information. This effectively makes the link(s) relative,
pointing to the target document’s own folder.
This macro is primarily designed to work with fields containing full
(absolute) paths. It will also work with Word’s relative link fields (which
have forward slashes instead of back slashes (i.e. “/†instead of “\\â€)), but
in all cases you will be prompted to update their paths individually. If you
have such fields and you erase the path or press Cancel when prompted to
update them, they’ll be left alone.
 
P

Pesach Shelnitz

Hi Jay,

On Vista computers, the default location of the Startup folder is
\Users\<username>\AppData\Roaming\Microsoft\STARTUP. On Windows XP computers,
the default location of the Word Startup folder is
\Documents and Settings\<Username>\Application Data\Microsoft\Word\STARTUP

On Vista computers, the default location of the template folder is
\Users\<username>\AppData\Roaming\Microsoft\Templates. On Windows XP
computers, the default location of the template folder is \Documents and
Settings\<username>\Application Data\Microsoft\Templates.

In Word 2007, to view (or modify) the locations of these folder, click the
Microsoft Office Button, click Word Options, click the Advanced tab, and then
click File Locations. In Word 2003, to view (or modify) the locations of
these folder, on the Tools menu click Options, and then click the File
Locations tab.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top