J
John
I am trying to remove all whitespace from the end of a footnote in Word 2007.
I create a footnote in a new document with lots of space on the end: "My
footnote "
I turn on the reveal codes/show marks (backwards P in ribbon).
I run this macro. Every space is removed except for the last one! Why??
(I could Trim the Range.Text, but that removes character styles as well which
I don't want to do)
Sub TrimSpaces()
lChr = ActiveDocument.Footnotes(1).Range.Characters.Last
cnt = 0
While lChr = Chr(32)
ActiveDocument.Footnotes(1).Range.Characters.Last.Delete
If cnt > 50 Then Exit Sub
cnt = cnt + 1
Wend
End Sub
I create a footnote in a new document with lots of space on the end: "My
footnote "
I turn on the reveal codes/show marks (backwards P in ribbon).
I run this macro. Every space is removed except for the last one! Why??
(I could Trim the Range.Text, but that removes character styles as well which
I don't want to do)
Sub TrimSpaces()
lChr = ActiveDocument.Footnotes(1).Range.Characters.Last
cnt = 0
While lChr = Chr(32)
ActiveDocument.Footnotes(1).Range.Characters.Last.Delete
If cnt > 50 Then Exit Sub
cnt = cnt + 1
Wend
End Sub