Strip Leading and Trailing spaces - Vba
Posted on 2003-11-25
I have some lines in my word document, which when viewed with bookmarks turned on, has a string of continuous leading or trailing spaces.(which I believe is created by pressing continuous spacebars).
One example of a line is:
provided at the end.
The text and the paragraphs in the document are aligned properly, pagemargins are fine. The only thing that annoys is these leading or trailing spaces. This annoys because we use these rtfs to another application and there these lines mess up.
Therefore I was wondering is there a macro or a vba code that can eliminate these leading or trailing spaces, and the text intend or alignment should not change by removing them. I would very happy if there is a way to convert these spaces to tabstops or so.
Anyway, a vba code to strip the leading and trailing spaces without having any impact on the format of the document, would help me greatly.