Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
replace format (subscript)
Is it possible to do the following:
I would like to change "O2" to Osubscript 2/subscript I can only change the whole word "O2" to subscript O2 /subscript If I just replace "2", I will run into trouble because the whole document has a lot of numbers. I use office 2k Thanks |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
replace format (subscript)
You can do it in stages.
Replace O2 with O &&2 (Note the space) Replace &&2 with ^& format superscript Replace space&& with nothing or by macro Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "O2" .Replacement.Text = "O &&2" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "&&2" .Replacement.Text = "^&" .Replacement.Font.Superscript = True End With Selection.Find.Execute replace:=wdReplaceAll Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = " &&" .Replacement.Text = "" End With Selection.Find.Execute replace:=wdReplaceAll -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Lamb Chop wrote: Is it possible to do the following: I would like to change "O2" to Osubscript 2/subscript I can only change the whole word "O2" to subscript O2 /subscript If I just replace "2", I will run into trouble because the whole document has a lot of numbers. I use office 2k Thanks |
#3
Posted to microsoft.public.word.newusers
|
|||
|
|||
replace format (subscript)
Thanks, Graham
A very good trick. "Graham Mayor" wrote in message ... You can do it in stages. Replace O2 with O &&2 (Note the space) Replace &&2 with ^& format superscript Replace space&& with nothing or by macro Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "O2" .Replacement.Text = "O &&2" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False End With Selection.Find.Execute replace:=wdReplaceAll Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = "&&2" .Replacement.Text = "^&" .Replacement.Font.Superscript = True End With Selection.Find.Execute replace:=wdReplaceAll Selection.Find.ClearFormatting Selection.Find.Replacement.ClearFormatting With Selection.Find .Text = " &&" .Replacement.Text = "" End With Selection.Find.Execute replace:=wdReplaceAll -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Lamb Chop wrote: Is it possible to do the following: I would like to change "O2" to Osubscript 2/subscript I can only change the whole word "O2" to subscript O2 /subscript If I just replace "2", I will run into trouble because the whole document has a lot of numbers. I use office 2k Thanks |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Format painter doesn't work with F5??!! | Microsoft Word Help | |||
Number format field | Page Layout | |||
Search and replace of format deleted text | Microsoft Word Help | |||
Bizarre wildcard replace | Microsoft Word Help | |||
wildcard replacing | Page Layout |