Results 1 to 4 of 4
  1. #1
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts

    Macro to 'Lock' fields in Word 2010?

    Is there some type of way or macro that could be attached to a button that could be used to change all fields in a document -- including in the header / footer -- to text so that it could be printed easily, and then, afterwards, convert them back? I suppose that the "convert them back" part could be accomplished by reloading the document, assuming it was first saved.

    Is there such a macro possible or available?

    Regards,
    Chuck Billow
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  2. #2
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts
    Clarification, the header and footer are not fields but can contain fields. I am assuming that you want to lock fields in the header/footer. Note, though, you do NOT want to be locking page fields. I'm not sure what fields you do want to lock. The purpose of most fields in a header/footer is to provide dynamic content that changes from page to page.

    This should do what you requested:
    Code:
    Sub FieldsLockAllStory()
    '   All Story Field Locker
    '   Written by Charles Kyle Kenyon 9 December 2004
    '   repaired with help from Jezebel 10 December 2004
        Dim oStory As Range
        On Error Resume Next
        For Each oStory In ActiveDocument.StoryRanges
            Do
                oStory.Fields.Locked = True
                Set oStory = oStory.NextStoryRange
            Loop Until oStory Is Nothing
        Next
    End Sub
    It is from one that I wrote to actually unlink fields (which is permanent). Headers and Footers are different "stories" than the main document.

    Check it out. If it does what you want, great.
    To reverse the process, you would change the Locked value to False.
    Last edited by Charles Kenyon; 2013-08-14 at 10:15.
    Charles Kyle Kenyon
    Madison, Wisconsin

  3. The Following User Says Thank You to Charles Kenyon For This Useful Post:

    CWBillow (2013-08-14)

  4. #3
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts
    Charles;

    Thanks. I apologize for not being clear.

    Yes, the header contains a field, as do the page itself and the footer. It is just a pain that to print the page I get walked through all the fields. This may well do the trick I appreciate your efforts, and I'll give you a shout-out once I've tried it/them out.

    Regards,
    Chuck
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

  5. #4
    Uranium Lounger CWBillow's Avatar
    Join Date
    Jul 2002
    Location
    Las Vegas, NV USA
    Posts
    6,371
    Thanks
    78
    Thanked 12 Times in 11 Posts
    Charles, that does EXACTLY what I need! You the man!

    Regards and thanks ever so,
    Chuck
    -------------------------------------------------
    "Good judgment comes from experience, and experience - well, that comes from poor judgment."

    ~ A(lan) A(lexander) Milne (1882-1956)- "House at Pooh Corner"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •