View Single Post
 
Old 08-09-2025, 08:28 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

RobiNew,


We will have to agree to disagree. The code you posted doesn't work to do anything.


Start with a document with 1 footnote.


Code:
Sub ScratchMacro()
  'Here is your code.  If you try to run it, you will see it does nothing but error
  With ftNote.Range
    .InsertBefore supLetter 'i.e. the letter a
    .Characters(1).Font.Superscript = True
  End With
lbl_Exit:
  Exit Sub
End Sub
Sub ScratchMacro2()
'Here is your code modified with variables declared and defined.
'No erorrs and doing what you decribed.
Dim ftNote As Footnote
Dim supLetter As String
  Set ftNote = ActiveDocument.Footnotes(1)
  supLetter = "a"
  With ftNote.Range
    .InsertBefore supLetter 'i.e. the letter a
    .Characters(1).Font.Superscript = True
  End With
  'As you see, this does nothing to the actual reference in the document body.
lbl_Exit:
  Exit Sub
End Sub
Sub ScratchMacro3()
'A basic Word Macro coded by Gregory K. Maxey
'This is my code. It gives the illusion that the reference number has been changed from 1 to 1a, but
'has no affect on the actual reference number in the document body.
Dim ftNote As Footnote
Dim supLetter As String
  supLetter = "a"
  Set ftNote = ActiveDocument.Footnotes(1)
  With ftNote
    .Range.Characters.First.Previous.Delete
    .Range = supLetter & " " & .Range
    .Range.Characters.First.Font.Superscript = True
  End With
lbl_Exit:
  Exit Sub
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote