Quote Originally Posted by gmaxey View Post
In my first post, I answered your posted question. How to lock/unlock CCs in the document footers.

To wrap a field located in the footers in a group control, it appears that you must select the content:

Public Sub SetGroupCCInFooters()
Dim rngStory As Word.Range
Dim lngJunk As Long
lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryType
Dim oCC As ContentControl
Dim oFld As Field
Dim oFtr As HeaderFooter
Dim lngView As Long
  lngView = ActiveDocument.ActiveWindow.View
  For Each rngStory In ActiveDocument.StoryRanges
    'Iterate through all linked stories
    Do
      On Error Resume Next
      Select Case rngStory.StoryType
        Case 8, 9, 11
          For Each oFld In rngStory.Fields
            If InStr(oFld.Code, "Classified") > 0 Then
              oFld.Code.Select
              Set oCC = Selection.ContentControls.Add(wdContentControlGroup, oFld.Code)
              oCC.LockContentControl = True
            End If
          Next oFld
        Case Else
          'Do Nothing
      End Select
      On Error GoTo 0
      'Get next linked story (if any)
      Set rngStory = rngStory.NextStoryRange
    Loop Until rngStory Is Nothing
  Next
  ActiveDocument.ActiveWindow.View = lngView
lbl_Exit:
  Exit Sub
End Sub
Hi, well I replaced
oFld.Code.Select
by
oFld.Select
But I still get an error "Method or Dataobject not found" here:
oCC.LockContentControl = True
I just want to Lock and group the Fields with the String "Klassifizierung" in its .code.text and lock this fields.

I tried:
If bState = True Then oCC.Select 
 Selection.Range.ContentControls.Add (wdContentControlGroup) 
 Selection.ParentContentControl.LockContentControl = bState
 Selection.Collapse
Else
 oCC.Select
 Selection.ParentContentControl.LockContentControl = bState
 Selection.Range.ParentContentControl.Ungroup
 Selection.Collapse
End If
but this does not work either... Still getting the view problem.
is there a chance to select something, but not switching the paneview to splitview?

best regards,
Andreas