Good thinking! Since it's unlikely that you ever want to apply direct
formatting to parts of a word, using the Words collection is more clever
than using Characters, and it should also save some time.
Why didn't I think of that?
Anyway, I'm glad you got it sorted, and thank you for the follow-up.
--
Stefan Blom
Microsoft Word MVP
---------------------------------------------
"Paul" wrote in message
OK, with help from here on m.p.w.v.g and from Stack Overflow, I finally
got it working the way I want it to. Instead of stepping through the
selection/range chraracter-wise, I'm doing it word-wise. It's fast
enough and fits the bill quite nicely. Thanks once more for all your
help. Working vba code is below:
Sub applyNewRevisedText(control as IRibbonControl)
Dim r As Range ' Create a new Range object
Set r = Selection.Range ' Assign the current selection to the Range
Dim rng As Range
For Each rng In r.Words
Set rngStyle = rng.Style
Select Case rngStyle
Case "Superscript"
rng.Style = ActiveDocument.Styles("New/Revised Text
Superscript")
Case "Subscript"
rng.Style = ActiveDocument.Styles("New/Revised Text Subscript")
Case "Emphasis"
rng.Style = ActiveDocument.Styles("New/Revised Text Emphasis")
Case "Bold"
rng.Style = ActiveDocument.Styles("New/Revised Text Bold")
Case "Italic"
rng.Style = ActiveDocument.Styles("New/Revised Text Italic")
Case "Bold Italic"
rng.Style = ActiveDocument.Styles("New/Revised Text Bold
Italic")
Case "Underline"
rng.Style = ActiveDocument.Styles("New/Revised Text Underline")
Case Else
rng.Style = ActiveDocument.Styles("New/Revised Text")
End Select
Next rng
End Sub