The RichTextBox control supports the RTF codes for super and subscripting, but the control itself does not give you access to those features.
Here is some simple code to add that functionality.
VB Code:
  1. Public Sub SetSubScript(RTB As RichTextBox)
  2. Dim iPos As Long
  3. Dim strRTF As String
  4.         With RTB
  5.         If .SelCharOffset >= 0 Then
  6.             iPos = .SelStart
  7.             .SelText = Chr(128) & .SelText & Chr(129) ' \'80 \'81
  8.             strRTF = Replace(.TextRTF, "\'80", "\sub\dn1 ")
  9.             .TextRTF = Replace(strRTF, "\'81", "\nosupersub\up0 ")
  10.             .SelStart = iPos
  11.         Else
  12.             .SelText = Chr(128) & .SelText
  13.             strRTF = .TextRTF
  14.             .TextRTF = Replace(strRTF, "\'80", "\nosupersub\up0 ", , 1)
  15.         End If
  16.         End With
  17. End Sub
  18.  
  19. Public Sub SetSuperScript(RTB As RichTextBox)
  20. 'add tags \super\up1 and \nosupersub\up0
  21. Dim iPos As Long
  22. Dim strRTF As String
  23.        
  24.       With RTB
  25.         iPos = .SelStart
  26.         If RTB.SelCharOffset <= 0 Then
  27.             .SelText = Chr(128) & .SelText & Chr(129) ' \'80 \'81
  28.             strRTF = Replace(.TextRTF, "\'80", "\super\up1 ")
  29.             .TextRTF = Replace(strRTF, "\'81", "\nosupersub\up0 ")
  30.         Else
  31.             .SelText = Chr(128) & .SelText
  32.             strRTF = .TextRTF
  33.             .TextRTF = Replace(strRTF, "\'80", "\nosupersub\up0 ", , 1)
  34.         End If
  35.         .SelStart = iPos
  36.        End With
  37.  
  38. End Sub