# Automatic-Subscript in Word



## orangepeel (Mar 2, 2005)

When it comes to writing chemical formulae, it is such a drag having to highlight each individual number and press the subscript button.  It is not so bad for the occasional H2O, but for something like [(C4H9)4N]2Mo8O26 this task becomes a real pain!  A program called ChemDraw has a button which, when selected, causes all highlighted numbers (and not highlighted letters) to be automatically made into subscript.  Such a button would make my relationship with Word a great deal sweeter.  Could this be achieved with a macro?  Has anyone written the code, or found an alternative solution?  

Many thanks.


----------



## scrupul0us (Mar 3, 2005)

This has already been discussed on this board once, use the search feature


----------



## orangepeel (Mar 3, 2005)

Search hasn't thrown up anything of much use.  Certainly, the word 'Subscript' only throws up this thread when I limit the search to this board.  Could it have been the following thread that you were thinking of?:

http://www.mrexcel.com/board2/viewtopic.php?t=87149&highlight=subscript+word+macro

If anyone has any more success than me in finding the relevent string, then I'd be glad to hear about it.  Otherwise, any further help would be much appreciated.  I am sure it would be a simple macro to write, if you knew how.


----------



## starl (Mar 3, 2005)

try this incredibly long link:

http://groups-beta.google.com/group..._doneTitle=Back+to+Search&&d#f0a0ac9075d9c29e


----------



## orangepeel (Mar 3, 2005)

Ooh!  That looks like just what I was looking for.  Thanks!


----------



## orangepeel (Mar 3, 2005)

I also found this macro:

http://www.geocities.com/Athens/Thebes/5118/download.htm

It is pretty exhaustive in what it does for you.  Unfortunately, I can't get it to work.  Perhaps becuase I run Office X on a mac.  Still, the debugger stalls with the following message on the very first line of code:

Compile error: 'Type-declaration character does not match declared data type.'

I don't think that is a windows/mac compatibility issue.  Has anyone else used this macro successfully?  I just wish I knew enough code to fix it.


----------



## starl (Mar 3, 2005)

Macs.. I charge extra for mac issues 

can you post the line ? I rather not install it....


----------

