View Single Post
 
Old 11-24-2014, 04:21 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

The code references 'TreatyStatement' because that's what you provided in your sample document and didn't indicate that it was variable. Accordingly, the simplest solution is to change:
Code:
      strNewNm = .SelectContentControlsByTitle("TreatyStatement/OurReference1")(1).Range.Text _
          & "_" & .SelectContentControlsByTitle("TreatyStatement/OurReference2")(1).Range.Text _
          & "." & Split(.Name, ".")(UBound(Split(.Name, ".")))
to:
Code:
      With .Tables(1).Cell(2, 2).Tables(1).Cell(3, 2).Range
        strNewNm = .ContentControls(1).Range.Text _
          & "_" & .ContentControls(2).Range.Text
      End With
      strNewNm = strNewNm & "." & Split(.Name, ".")(UBound(Split(.Name, ".")))
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote