Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2007

Tip: Looking for answers? Try searching our database.

Remove whitespace in footnotes fails

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 08 Feb 2007 21:45 GMT
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
John - 08 Feb 2007 22:33 GMT
>I am trying to remove all whitespace from the end of a footnote in Word 2007.
>
[quoted text clipped - 18 lines]
>
> End Sub

I meant: (doesn't work)

Sub TrimSpaces()
lChr = ActiveDocument.Footnotes(1).Range.Characters.Last
cnt = 0
While lChr = Chr(32)
   ActiveDocument.Footnotes(1).Range.Characters.Last.Delete
    lChr = ActiveDocument.Footnotes(1).Range.Characters.Last
   If cnt > 50 Then Exit Sub
   cnt = cnt + 1
Wend

End Sub
John - 10 Feb 2007 15:22 GMT
Anyone? This is driving me nuts! :-)

>>I am trying to remove all whitespace from the end of a footnote in Word
>>2007.
[quoted text clipped - 33 lines]
>
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.