' Offset numerals by the indicated amount.
Private Sub RichTextSubscriptNumerals(ByVal rch As _
RichTextBox, Optional ByVal offset As Integer = -50)
Dim i As Integer
Dim txt As String
txt = rch.Text
For i = 1 To Len(txt)
If Mid$(txt, i, 1) >= "0" And Mid$(txt, i, 1) <= _
"9" Then
rch.SelStart = i - 1
rch.SelLength = 1
rch.SelCharOffset = offset
End If
Next i
End Sub
' Draw a formuls offseting numerals by the indicated amount.
Private Sub FormPrintFormula(ByVal frm As Form, ByVal X As _
Single, ByVal Y As Single, ByVal txt As String, _
Optional ByVal offset As Single = 60)
Dim i As Integer
Dim ch As String
frm.CurrentX = X
For i = 1 To Len(txt)
ch = Mid$(txt, i, 1)
If ch >= "0" And ch <= "9" Then
frm.CurrentY = Y + offset
Else
frm.CurrentY = Y
End If
frm.Print ch;
Next i
End Sub
|