Thread: [Solved] Save Selection
View Single Post
 
Old 01-13-2011, 01:52 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Quote:
Originally Posted by cksm4 View Post
I am assuming that the name of the control (1, 2, 3... etc) is based on its order. Is this true? Is it possible to name a control differently?
I believe so.
Also, once I have merged all my documents together, is there a way to run this by section?[/quote]Simple. Try something along the lines of:
Code:
Sub Demo()
Dim strTmp As String, iSctn As Integer
iSctn = InputBox("Which Section to process?")
If iSctn = "" Then Exit Sub
With ActiveDocument.Sections(iSctn).Range
  strTmp = .ContentControls(1).Range.Text
  strTmp = strTmp & ":" & .ContentControls(2).Range.Text
  strTmp = strTmp & ":" & .ContentControls(3).Range.Text
  .Indexes.MarkEntry Range:=.Bookmarks("IndexThis").Range, _
    Entry:=strTmp, CrossReference:="", CrossReferenceAutoText:="", _
    BookmarkName:="", Bold:=False, Italic:=False
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote