How to make 'find' look at just 1st char in every line?

  • Thread starter Thread starter JKap
  • Start date Start date
J

JKap

I am trying to delimit the WORD "find and replace" function so that it just
looks at the very first character of every line. For example, I have a large
document that begins each line with a period. I want to find . and replace
it with { .

Honest and non-insulting replies / suggestions are appreciated.
 
If each line in your document is a separate paragraph, put ^p in the Find
what control and ^p{ in the Replace with control

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
While Doug's method will work (apart from the first line), again assuming
each line is a paragraph, you could use a macro

Dim oRng As Range
With ActiveDocument
For i = 1 To .Paragraphs.Count
Set oRng = .Paragraphs(i).Range
If oRng.Characters(1) = "." Then
oRng.Characters(1) = "{"
End If
Next i
End With

If you want a space after the bracket, then add that space between the
quotes.
oRng.Characters(1) = "{ "

http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Back
Top