ContentControl.Range property (Word)
Returns a Range that represents the contents of the content control in the active document. Read-only.
Syntax
expression.Range
expression An expression that returns a ContentControl object.
Remarks
Use the Range property to access the text, the formatting for the text, and other text properties. For more information, see Working with Range Objects.
Example
The following example inserts a date content control into the active document, and then sets the contents of the content control and specifies that the user cannot edit the contents or delete the control from the document.
Dim objCC As ContentControl
Set objCC = ActiveDocument.ContentControls _
.Add(wdContentControlDate)
objCC.Range.Text = "January 1, 2007"
objCC.LockContents = True
objCC.LockContentControl = True
See also
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for