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 / August 2003

Tip: Looking for answers? Try searching our database.

a macro for delete the two first letters from any line

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
giannis - 31 Aug 2003 22:34 GMT
I have a txt that all lines (except the empty lines)
have two (2) spaces in the beginning.
I need a macro that delete the these two spaces
from all the lines [except these that have only a
paragraph mark (=empty lines)]
Can you help me ?
I am new in VB and i need some help for the commands
and functions that must use for this macro.
(sorry for my english but i am not speak very well...)
Doug Robbins - Word MVP - 31 Aug 2003 23:34 GMT
Hi Giannis,

I assume that the lines either end with a paragraph mark ? or a hard line
break (an arrow pointing down and to the left).  For the former, you can use

^p<space><space>          i.e. ^p followed by two spaces

in the Find what box of the Edit>Replace dialog and use a single space in
the Replace with box.

If it's the latter, use

^l<space><space>        that's a lower case L

in the Find what box

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
> I have a txt that all lines (except the empty lines)
> have two (2) spaces in the beginning.
[quoted text clipped - 5 lines]
> and functions that must use for this macro.
> (sorry for my english but i am not speak very well...)
 
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.