Automating RTrim() from VBA

T

tmaynard

I have a long, single-column document which will be converted to
table. It's an address list for a mail-merge, with firstname
lastname, address, etc., each on its own line.

However, each field (i.e., line) has some trailing spaces (an artifac
of the cut/paste source of the data: an AS/400).

I'd like to execute an RTrim() on each line of the file.

Any clues, pointers, suggestions are welcome!
Thanks,
Tom
 
D

Doug Robbins - Word MVP

Use a Wildcard replace with [ ]{1,}^13 in the Find what control and ^p in
the Replace with control.

See the article “Finding and replacing characters using wildcards” at:

http://word.mvps.org/FAQs/General/UsingWildcards.htm

Also take a look at the final part of the article "Convert Labels into Mail
Merge Data File" on fellow MVP Graham Mayor's website at
http://www.gmayor.com/convert_labels_into_mail_merge.htm


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
T

tmaynard

Doug,

I confess I never thought that a simple find/replace would work in thi
situation. It did, and was a much better solution.

I'm studying the two links, hoping to glean more!

Thanks,
Tom
 
T

tmaynard

Doug,

I confess I never thought that a simple find/replace would work in thi
situation. It did, and was a much better solution.

I'm studying the two links, hoping to glean more!

Thanks,
Tom
 
T

tmaynard

Doug,

I confess I never thought that a simple find/replace would work in thi
situation. It did, and was a much better solution.

I'm studying the two links, hoping to glean more!

Thanks,
Tom
 
D

Doug Robbins - Word MVP

Please ask IRubin to fix up his crappy WordForums.com website so that it
doesn't cause duplicates and triplicates of the messages posted to his site
to appear on the servers that actually host these newsgroups. For you own
part, I would suggest that you do not access the newsgroups via
WordForums.com. If you can, use a newsreader such as Outlook Express. If
you cannot use that, then connect to the newsgroups via
http://communities.microsoft.com/newsgroups/default.asp Your posts will
appear more promptly and answers will also be available as soon as they are
posted, rather than when IRubin gets around to it.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
H

Howard Kaikow

Just what is www.WordForms.com?

I just looked at it for the first time.
It seems to be copying threads from MSFT newsgroups.

Is the forum just a means to read/post particular Office related MSFT
newsgroups?
 
D

Doug Robbins - Word MVP

Hi Howard,

In answer to your last question, I believe "yes", but a poor one at that.

It would seem fairly certain that there is no moderation of responses to
posts that originate from www.WordForums.com <g>

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top