If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How to make 'find' look at just 1st char in every line?
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. |
#2
|
|||
|
|||
How to make 'find' look at just 1st char in every line?
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 "JKap" wrote in message ... 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. |
#3
|
|||
|
|||
How to make 'find' look at just 1st char in every line?
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 Word MVP web site http://word.mvps.org JKap wrote: 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. |
Thread Tools | |
Display Modes | |
|
|