View Single Post
 
Old 08-14-2013, 08:32 AM
gmaxey gmaxey is offline Windows 7 32bit Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Select the range.

Code:
Sub ScratchMacro()
Dim i As Long
Dim myContentControl As ContentControl
  For i = 1 To ActiveDocument.ContentControls.Count
    If ActiveDocument.ContentControls(i).Title = "test" Then
      Set myContentControl = ActiveDocument.ContentControls(i)
      Exit For
    End If
  Next
  myContentControl.Range.Select
End Sub
why do you want to loop through all of the ccs to do this though? Why not:

Code:
Sub ScratchMacroII()
ActiveDocument.SelectContentControlsByTitle("test").Item(1).Range.Select
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote