Chemical formulae in word

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I think word should be able to detect chemical formulae - firstly to have a
go at getting the superscripting and subscripting automatic, because it's
very fidlly to do manually, and secondly so that it knows not to bring them
up as spelling and grammar errors.

Also, is there some way I can tell it when a document is notes, so I don't
get continual grammar errors.
 
G'Day Owl,

Create a Word Document in which there is a Table of
Chemical Formulae:

Column 1 Column 2
Plain Text Formatted Text (ie with subscripts
and
superscripts)

Use a Macro to traverse the table to create AutoCorrect
entries for your chemical formulae.
 
Thanks Pat

I have considered putting formulae into autocorrect, but the nature of the
notes I'm making means that I'm rarely repeating the same formulae, so I
would have to enter each new formula separately, as far as I know. I was
envisaging something more general, that could recognise a chemical formula in
the same way as it recognises names, addresses and dates. Rather a tall
order, I know, but I thought I'd suggest it.
 
If you tell Word to ignore Words containing numbers when it spell checks
that will solve one of your problems. And if you use the keyboard shortcuts
for sub- and superscript (Ctrl+= and Ctrl+Shift+=), they will quickly become
automatic. You could also, if you prefer, add toolbar buttons for these
properties.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
I doubt that Microsoft is interested enough in the modest number of
chemists, who often get academic versions cheaply anyway. They have
enough trouble providing for the hordes of lawyers, who at least
supposedly pay full price. They might also have trouble knowing
exactly what you want a chemical formula to end up looking like.

If I had to do this, I would consider a macro. If all numbers are
subscripts it should be reasonably simple. If the only superscripts
are immediately after plus sign or minus sign it is still simple. If
you are using superscripted atomic weights it is a little dicier.

Type in the formula straight, double-click it to select it, and push
the button for the macro.

The macro would do something like the following (you need to be able
to specify exactly what it is you want to happen of course):

Shorten the range to exclude the trailing space.
Apply the ChemForm character style.
If it wasn't present, create it, with attributes no spelling
plus any font etc that you want
Superscript a single digit after a plus or minus sign
Subscript any other digits

If you need positioning of numbers when there is both a subscript and
a superscript present, it is a little trickier because it would
require an EQ field, but it is probably still do-able.

If you ask in microsoft.public.word.vba.general someone may write it
for you. It could be an interesting challenge. If you got something
working, maybe Microsoft would copy it.

Bob S
 
Back
Top