Is it possible to copy a word document page but leave the first 3 space
behind on every line for the whole document I need to do this for over 3000
pages so do not want to by line by line I am trying to achieve:
001 dsfdsfsd
002 sdfdsfsdf
003 sdfdsfsdf
to becomes
dsfdsfsd
sdfdsfsdf
sdfdsfsdf
is this possible
Many thanks
Marcus
Marcus
Chuck Henrich - 26 Jul 2005 16:09 GMT
How's this - it goes through each paragraph (assuming each line is actually a
paragraph) and strips off the first 4 chars):
Dim x As Long
Dim strString As String
With ActiveDocument
For x = 1 To .Paragraphs.Count
strString = .Paragraphs(x).Range.Text
strString = Right(strString, Len(strString) - 4)
.Paragraphs(x).Range.Text = strString
Next x
End With
HTH

Signature
Chuck Henrich
www.ProductivityApps.com
> Is it possible to copy a word document page but leave the first 3 space
> behind on every line for the whole document I need to do this for over 3000
[quoted text clipped - 17 lines]
>
> Marcus
Chuck Henrich - 27 Jul 2005 11:50 GMT
An alternative method not using a macro would be to use a wildcard search:
Search for: ([0-9]{3}) (*)
Replace with: \2
(Note that there is a space after {3} and before the closing round bracket.
{3} specifies how may digits - if there were 5 digits you'd change the 3 to a
5. Make sure "Use wildcards" is ticked.)
By putting round brackets around any text you can "mark" it as a discrete
component that can be referred to in the replace with field as "\1" (first
bracketed section), "\2" (second bracketed section) etc.
For more information look at the (murky) help section on wildcard searches.
HTH

Signature
Chuck Henrich
www.ProductivityApps.com
> Is it possible to copy a word document page but leave the first 3 space
> behind on every line for the whole document I need to do this for over 3000
[quoted text clipped - 17 lines]
>
> Marcus
Graham Mayor - 27 Jul 2005 14:48 GMT
> For more information look at the (murky) help section on wildcard
> searches.
>
> HTH
For less murk see http://www.gmayor.com/replace_using_wildcards.htm

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Chuck Henrich - 27 Jul 2005 15:50 GMT
Excellent resource - thanks Graham!

Signature
Chuck Henrich
www.ProductivityApps.com
> > For more information look at the (murky) help section on wildcard
> > searches.
> >
> > HTH
>
> For less murk see http://www.gmayor.com/replace_using_wildcards.htm