View Single Post
 
Old 09-05-2019, 04:01 PM
gmaxey gmaxey is offline Windows 10 Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,422
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

I can't see any relevance between the code you have posted and the object you are after. What does "^+" have to do with Em dashes? What does .Font.Bold = True have to do with Title Case? What is all that gibberish about If .Find.Found?



If your text is like your example (all terms constitute as single paragraph then:

Code:
Sub ConvertToTC()
Dim oRng As Range
  Set oRng = ActiveDocument.Range
  With oRng.Find
    .Text = ChrW(8212)
    While .Execute
      With oRng
        .End = .Paragraphs(1).Range.End
        .Start = oRng.Start + 1
        .Case = wdTitleWord
        .Collapse wdCollapseEnd
      End With
    Wend
  End With
lbl_Exit:
  Exit Sub
 End Sub

BREAK


Paul, what makes an "Expert" in this forum?
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote