Reset Superscript setting for space immediately following footnotereference number

A

andreas

Dear Experts:
below macro replaces the footnote reference number in the footnotes
story with the footnote reference number and a space. Regrettably this
space has got a superscript setting. When trying to undo this
superscript setting with the code lines starting "For Each rngFoot in
ActiveDocument.Footnotes...." nothing happens. What's wrong with this
code?.
Help is appreciated. Thank you very much in advance. Regards, Andreas


Sub InsertSpaceAfterfootnote


Dim rngfoot as footnote

With ActiveDocument.StoryRanges(wdFootnotesStory).Find
..ClearFormatting
..Replacement.ClearFormatting
.Text = "(^2)"
.Replacement.Text = "\1 "
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With

' Comment: the following lines do nothing to the footnotes. Why?
For Each rngFoot In ActiveDocument.Footnotes
If rngFoot.range.Characters.First = Chr(32) Then
rngFoot.range.Characters.First.Font.Reset
End If
Next
End Sub
 
D

Doug Robbins - Word MVP on news.microsoft.com

Replace all of the code that you are using with

Dim rngfoot As Footnote
Dim ftext As Range

For Each rngfoot In ActiveDocument.Footnotes
Set ftext = rngfoot.Range
ftext.InsertBefore " "
Next


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
A

andreas

Replace all of the code that you are using with

Dim rngfoot As Footnote
Dim ftext As Range

For Each rngfoot In ActiveDocument.Footnotes
    Set ftext = rngfoot.Range
    ftext.InsertBefore " "
Next

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com










- Show quoted text -

Hi Doug,

ok, great. This did the trick. Thank you very much. Regards, Andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top