• Remove space before superscripts

    Author
    Topic
    #471900

    I’m using Word 2002. I have a document with both footnotes and endnotes. Actually the endnotes are to be manually inserted at the end of the document. The endnote references in the text are just superscript numbers. The author has an extra space in front of each endnote number. How would I phrase a search and replace to get rid of that space?

    Viewing 1 reply thread
    Author
    Replies
    • #1246647

      Hi altdotcom,

      For real footnotes or endnotes, you can do this with a wildcard Find/Replace, where:
      Find = ( {1,})(^2)
      Replace = 2

      For superscripted numbers, unless the preceding space is also superscripted, you’ll need a macro like:

      Code:
      Sub Demo()
      With ActiveDocument.Range
        With .Find
          .ClearFormatting
          .Text = ""
          .Font.Superscript = True
          .Replacement.Text = ""
          .Forward = True
          .Wrap = wdFindStop
          .Format = True
          .MatchCase = False
          .MatchWholeWord = False
          .MatchWildcards = False
          .MatchSoundsLike = False
          .MatchAllWordForms = False
          .Execute
        End With
        Do While .Find.Found
          Do While .Characters.First.Previous = " "
            .Characters.First.Previous.Delete
          Loop
          .Collapse wdCollapseEnd
          .Find.Execute
        Loop
      End With
      End Sub

      The above code will also handle real footnotes and endnotes.

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • #1246725

      Thanks, I’ll try it.
      Clark

    Viewing 1 reply thread
    Reply To: Remove space before superscripts

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: