Macro/VB to turn on Update Fields & Links

K

Kamran

I need help creating a macro I can insert into a Word document that will set
user options in Tools > Setup so that Update Fields and Update Links are
checked on the Print Tab. Thanks.
 
L

Lene Fredborg

The following code lines will turn on the "Update fields" and "Update links"
options in Tools > Options > Print tab:

With Options
.UpdateFieldsAtPrint = True
.UpdateLinksAtPrint = True
End With

See this article if you need help on installing macros:
http://www.gmayor.com/installing_macro.htm

Tip: If you record a macro while changing options settings, you will most
likely be able to find out which VBA code correspond to which settings.

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
K

Kamran

Thanks. I forgot to mention that it needs to run when the user opens the
document -- what can I add to it?
 
L

Lene Fredborg

You could insert the code in a macro named "AutoOpen" and store the macro in
a code module in the document:

Sub AutoOpen
[insert the code here]
End Sub

For further information about auto macros, see "Running a macro
automatically when a document is created, opened or closed":
http://word.mvps.org/faqs/macrosvba/DocumentEvents.htm

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 
K

Kamran

Thanks for the tip, Lene. Nothing like getting assistance from Denmark on a
Word problem in Washington, DC!
 

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