irina_1973
asked on
Subscript and Unicode text to the Word from VB
It's seem to me very difficult.
I created a Word Document from VB.
Now I want to insert some text ,for example "Ak".
But to insert "k" subscript . How can I do it from VB.
And maybe somebody know how to insert also Unicode char to the word from VB.(for example U+2113 -small l)
Please ,help me !
I created a Word Document from VB.
Now I want to insert some text ,for example "Ak".
But to insert "k" subscript . How can I do it from VB.
And maybe somebody know how to insert also Unicode char to the word from VB.(for example U+2113 -small l)
Please ,help me !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sub Insert_Text()
Dim appWd As Word.Application
Set appWd = GetObject(, "Word.Application")
With appWd.Selection
.TypeText Text:="A"
.Font.Subscript = wdToggle
.TypeText Text:="k"
.Font.Subscript = wdToggle
End With
End Sub
Not sure about the Unicode char, to insert it using the Decimal ASCII code you can use Chr, for example:
Selection.TypeText Chr(105)