![]() |
|
|||||||
|
|
|
Thread Tools | Display Modes |
|
|
|
#1
|
|||
|
|||
|
The code in post 4 should change superscripts in the main text leaving footnotes intact. And this is the fastest way (as far as I know).
But (just in case) try this one. It doesn't use With...End With block: Code:
Sub Superscripts_To_Regular_MainTxt()
'Change all superscripts to normal text only in wdMainTextStory (1).
For Each aStory In ActiveDocument.StoryRanges
If aStory.StoryType = wdMainTextStory Then aStory.Font.Superscript = False
Next aStory
End Sub
|
|
#2
|
|||
|
|||
|
It is really very simple. Just replace Selection with the range you want to find in. For example ActiveDocument.Content which is the same as the MainStory:
Code:
Sub ReplaceSuperscript()
With ActiveDocument.Content.Find
.ClearFormatting
With .Font
.Superscript = True
.Subscript = False
End With
.Replacement.ClearFormatting
With .Replacement.Font
.Superscript = False
.Subscript = False
End With
.Text = "[!^02]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
End Sub
Code:
Sub ReplaceSuperscript()
Dim story As Range
For Each story In ActiveDocument.StoryRanges
With story.Find
.ClearFormatting
With .Font
.Superscript = True
.Subscript = False
End With
.Replacement.ClearFormatting
With .Replacement.Font
.Superscript = False
.Subscript = False
End With
.Text = "[!^02]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
Next story
End Sub
|
|
#3
|
|||
|
|||
|
Thanks a lot, Italophile! Your second code is exactly what I need. Thanks again!
|
|
| Tags |
| replace, superscript |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Loop through Footnote Reference Marks
|
Ramses505 | Word VBA | 6 | 09-21-2023 12:10 AM |
Macro to change font size of Footnote Reference in Footnote Text
|
TheBigBoss | Word VBA | 5 | 06-10-2022 06:14 AM |
| Need to change superscripts to regular text but also add parentheses | DCabby | Word VBA | 4 | 11-13-2019 09:43 AM |
Convert endnote/footnote to regular text
|
Cobb78 | Word | 5 | 07-11-2016 06:23 AM |
Regular (roman) character style doesn't change text to roman
|
kcbenson | Word | 2 | 10-16-2014 01:31 PM |