Question : Search and replace text containing superscripts in Word

Hi,

I have many documents in Microsfot Word 2007 (RTF, DOC or DOCX) which the text includes superscripts. One of the issues I need to solve is to find and replace sentences in which a superscript is located after the stop (the dot), adding a carriage return after the superscripts.

The sentences look like:

First sentence.superscripts Another sentence.

Please take into account the following:

1.- I cannot simply search for superscripts and add a carriage return after every superscript. This would be easy in Word, but it will create more problems that it solves. The documents have hundred or even thousands of superscripts. The only ones I need to add the carriage return to, are the ones that have the superscript after the stop AND there is a sentence afterward.

2.- The superscript can be quite complex, meaning it is not a single character or single number superscript. It can be a combination of numbers + characters, or several numbers or characters, or something like 2 + 5a. In any event, the carriage return should always go after a superscripted text that is located after a stop.

3.- Because the superscripted text is unpredictable (as mentioned in point 2), the macro should find and select all superscripted text after the stop and then add the carriage return.

Any ideas,

Thank you

Answer : Search and replace text containing superscripts in Word

True, but with the unique end delimiter, you can add an interim step to fix that: find any white space followed by the unique character and replace it with the reverse. Try something like this (I'm on a system without Word right now so can't test it);

Find what: ([ ]{1,3})(ÿ)
Replace with: \2\1
Wildcards on

This would handle the case of 1-3 spaces. You can adjust if there are >3, and could add codes for tabs and fixed spaces if applicable. This method will only "fix" the ending spaces; internal spaces will still remain superscript.

Your point is a good one BTW: in a "normal" manuscript that uses the Footnote Reference character style, the superscript won't include the trailing space, but when the superscripting is done manually, the trailing space erroneously retains the formatting. I often see instances like 1iere where the superscript "iere" is squished against the following word. This particular fix is included in a routine macro I use to tidy up manuscripts coming in.
Random Solutions  
 
programming4us programming4us