M
MikeM
Being a scientist, I use a lot of symbols repetitively. Over time, I've
either created Macros with a dialog box or run by an individual keystroke.
They all work fine except for the ones that involve super/subscripts. For
example, I want to put in the text'Mg2+' where the 2+ is superscripted. The
macro is as follows:
Public Sub MAIN()
WordBasic.Insert "Mg"
WordBasic.Superscript
WordBasic.Insert "2+"
WordBasic.Superscript
WordBasic.Insert " "
End Sub
The last 2 lines supposedly would remove the superscript and then insert a
space. If the insertion point is at the end of a line, with only spaces
following, OR if it's between 2 spaces, this works fine. However, if there
is no space following, everything ends of superscripted, not only the entire
Mg2+, but the following word.
That is, insertion point is next to the 't' of transporter. If I insert the
Mg2+, instead of Mg/super/2+/endsuper/space'transporter', I get 'Mg2+
transporter' with every single character superscripted. Happens in other
similar macros whether super or subscripted. Does the same thing whether the
macro inserts a space at the end or not. I'm sure it's my ignorance of
Visual Basic, since all my macros are just edits of some generic ones, but
what am I doing wrong. Thanks
either created Macros with a dialog box or run by an individual keystroke.
They all work fine except for the ones that involve super/subscripts. For
example, I want to put in the text'Mg2+' where the 2+ is superscripted. The
macro is as follows:
Public Sub MAIN()
WordBasic.Insert "Mg"
WordBasic.Superscript
WordBasic.Insert "2+"
WordBasic.Superscript
WordBasic.Insert " "
End Sub
The last 2 lines supposedly would remove the superscript and then insert a
space. If the insertion point is at the end of a line, with only spaces
following, OR if it's between 2 spaces, this works fine. However, if there
is no space following, everything ends of superscripted, not only the entire
Mg2+, but the following word.
That is, insertion point is next to the 't' of transporter. If I insert the
Mg2+, instead of Mg/super/2+/endsuper/space'transporter', I get 'Mg2+
transporter' with every single character superscripted. Happens in other
similar macros whether super or subscripted. Does the same thing whether the
macro inserts a space at the end or not. I'm sure it's my ignorance of
Visual Basic, since all my macros are just edits of some generic ones, but
what am I doing wrong. Thanks