Thread: [Solved] Need help in content control
View Single Post
 
Old 04-16-2022, 06:59 AM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

For example:
Code:
Private Sub AutoClose()
Dim CCtrl As ContentControl, Cancel As Boolean: Cancel = False
With ActiveDocument
  For Each CCtrl In .ContentControls
    If CCtrl.ShowingPlaceholderText = True Then Cancel = True: CCtrl.Range.Select: Exit For
  Next
  If Cancel = True Then
    MsgBox "Please complete all the items"
    .Saved = False
    SendKeys "{ESC}"
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote