View Full Version : Automating Format Painter using VBA


aziz rasul
02-20-2006, 01:44 AM
I have a document where I have dates written like so: -

7th of August
13th of February
3rd of July
1st of May

and so on.

The 'th', 'rd' and 'st' parts are not superscript and I want to make them so. How do I create a macro or create a function using VBA that sweeps thru the document and sense wherever there is a number followed by a 'th', 'rd' or 'st' and make the 'th', 'rd' and 'st' superscript?

Rod D
02-20-2006, 03:55 AM
You don't really need VBA to do this.

To update the text in the document, Click on Format (from main menu bar), then AutoFormat...

A dialog opens that allows you to update the entire document.
Click on the Options Button to open the formatting dalog box and ensure that the Ordinals (1st) with Superscript is checked, then Click the OK button to close the dialog box.

You can then update your document by clicking the OK button.

I have attached some screen shots, just in case.

Hope this Helps
Rgds
Rod

aziz rasul
02-20-2006, 04:15 AM
I tried that, but it deletes the empty lines between the paragraphs as well as solving the problem that I had.

Even when I ONLY have a check mark against the Ordinals ...

Rod D
02-20-2006, 05:01 AM
Took me a while to replicate your problem - looks like it is linked to having differing paragraph formats. Just have to figure out how to switch that bit off now!