Results 1 to 12 of 12

Thread: How to lock/unlock ContentControls in ALL Footers

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    You don't need to select controls or story ranges in order to process them. Selecting items in the footer will open the footer, hence the problem you had.
    You need to use instead ranges.
    You can process the document range instead
    With ActiveDocument.Range
            .LanguageID = wdGerman
            .NoProofing = True
    End With
    Greg's code creates ranges for the headers and footers so you can process those ranges also
    Select Case rngStory.StoryType    Case 8, 9, 11
            With rngStory
                .LanguageID = wdGerman
                .NoProofing = True
            End With
            For Each oCC In rngStory.ContentControls
                oCC.LockContentControl = bState
            Next oCC
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  2. #2

    Object or Method not found...

    Quote Originally Posted by gmayor View Post
    You don't need to select controls or story ranges in order to process them. Selecting items in the footer will open the footer, hence the problem you had.
    You need to use instead ranges.
    You can process the document range instead
    With ActiveDocument.Range
            .LanguageID = wdGerman
            .NoProofing = True
    End With
    Greg's code creates ranges for the headers and footers so you can process those ranges also
    Select Case rngStory.StoryType    Case 8, 9, 11
            With rngStory
                .LanguageID = wdGerman
                .NoProofing = True
            End With
            For Each oCC In rngStory.ContentControls
                oCC.LockContentControl = bState
            Next oCC
    Hello,
    thanks for your response. It works almost perfect I guess, BUT:
    oCC.LockContentControl = bState
    brings an error:
    Error while compiling:
    Method or Dataobject not found

    And how may I group the oCC, I was using:
    Selection.Range.ContentControls.Add (wdContentControlGroup)
    without "select"?

    Thanks a lot for your help!!

    best regards,
    Andreas

Tags for this Thread

Posting Permissions

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