Sub Test()
Selection.Collapse
Selection.Moveright unit:=wdCharacter, Extend:=True
If Selection.Font.Subscript Then
MsgBox "subscript = true"
End If
End Sub
I have to transform a chemical formular eg: H2O into a HTML compatile form
eg H<sub>2</sub>O.
So I have to find out if the number is a normal one or a subscript
And I'm not programming nativ Word but with VB2005 against the Word Object
Model, I thought this is the wright NG for this Problem... ( I hope so)
Sub Test1f()
Dim rdcm As Range
Set rdcm = ActiveDocument.Range
With rdcm.Find
.Font.Subscript = True
While .Execute
' rdcm.Select ' for testing
rdcm.Font.Subscript = False
rdcm.InsertBefore "<sub>"
rdcm.InsertAfter "</sub>"
Wend
End With
End Sub
--