Hi all,

adding a footnote number in superscript means typing the number, marking it, use superscript - and while going on typing, the superscript mode remains ...

My idea: I would like to have a macro allowing the user to insert some text to an Input box and this text gets inserted as superscripted text (or number), exactly where the cursor is located. But after inserting, the user can go on typing in normal mode without the need to switch back anything to normal.

But unfortunatley I'm not getting this superscript-and-back hing right.

Can anyone help me fix it to the way I described?

Thank you,
RG

Option Explicit
Sub AutoSuperscript()
Dim Message As String
Dim Title As String
Dim Default As String
Dim myValue As String

'The Input box works well

Message = "Insert your superscripted text"
Title = "Superscript Input"
Default = "1"
myValue = InputBox(Message, Title, Default)

'Handles if User cancels
On Error GoTo UserCancels

'Adding the text at the position of the cursor - usually the end of a word - works, but it is not set to superscript mode:

With ActiveWindow.Selection
    .TextRange2.Font.Superscript = msoTrue
    .TextRange2.Text = myValue
    .TextRange2.Font.Superscript = msoFalse
End With

UserCancels:
    Exit Sub

End Sub