Sub LockCC()
SetCCStateInFooters True
lbl_Exit:
Exit Sub
End Sub
Sub UnlockCC()
SetCCStateInFooters False
lbl_Exit:
Exit Sub
End Sub
Public Sub SetCCStateInFooters(bState As Boolean)
Dim rngStory As Word.Range
Dim lngJunk As Long
Dim oShp As Shape, oCanShp As Shape
lngJunk = ActiveDocument.Sections(1).Headers(1).Range.StoryType
Dim oCC As ContentControl
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 oCC In rngStory.ContentControls
oCC.LockContentControl = bState
Next oCC
If rngStory.ShapeRange.Count > 0 Then
For Each oShp In rngStory.ShapeRange
If oShp.TextFrame.HasText Then
For Each oCC In oShp.TextFrame.TextRange.ContentControls
oCC.LockContentControl = bState
Next oCC
End If
If oShp.Type = msoCanvas Then
For Each oCanShp In oShp.CanvasItems
If oCanShp.TextFrame.HasText Then
For Each oCC In oCanShp.TextFrame.TextRange.ContentControls
oCC.LockContentControl = bState
Next oCC
End If
Next oCanShp
End If
Next
End If
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
lbl_Exit:
Exit Sub
End Sub