RE: Need Macro to Lock all Links by MKG
MKG
Tue Jun 26 11:32:01 CDT 2007
Perfect! I was even able to interpolate your code to fit the type of fields
in use, so I've gotten exactly what I needed.
Thank you very much!
"Lene Fredborg" wrote:
> You can use something like the following:
>
> Dim oField As Field
>
> For Each oField In ActiveDocument.Fields
> 'You may need to check other types of fields too
> If oField.Type = wdFieldLink Then
> oField.Locked = True
> End If
> Next oField
>
> To unlock the fields, Locked = false
>
> Note: If you select the entire document and press Ctrl+F11, you lock _all_
> fields (incl. cross-references etc.). This may not be what you want.
>
> --
> Regards
> Lene Fredborg
> DocTools - Denmark
> www.thedoctools.com
> Document automation - add-ins, macros and templates for Microsoft Word
>
>
> "MKG" wrote:
>
> > I need a macro which will lock all links in the document on screen. For Word
> > 2003.
> >
> > There are two ways we can do this manually:
> > 1. Select the entire document and press Ctrl+F11
> > 2. Edit-Links-(Select all links in document), click Locked under "update
> > method for selected link")
> >
> > But I need a macro to do this since the users who need to take these actions
> > may find the process confusing. I haven't been able to record a macro to do
> > this.
> >
> > Can anyone provide me with the code to do this?