Maybe my mind got grilled, but somehow I can't make Word find empt lines in order to delete them.
The plan was/is to look for all double Line-ends and than to dlete one of them.
Maybe I'm not really used to those 40 degrees C in here.
Maybe my mind got grilled, but somehow I can't make Word find empt lines in order to delete them.
The plan was/is to look for all double Line-ends and than to dlete one of them.
Maybe I'm not really used to those 40 degrees C in here.
Hi,
For this I usually just go via menu to
Find and Replace
Find What: ^p^p
Replace with: ^p
Replace All (Maybe run this more than once...)
This might vary if you mean Manual Line Break instead of Paragraph mark. Go to in Find and Replace to More > Special for list of all possible symbols).
Hope I got your piont and this can help you!
jl88
Thanks for the help. I was looking into this menu very deep, but it doesn't work for the document I'm working on( tested all formating possiblities)
The problem is I have a file that needs to be imported to word, and while importing it gets empty lines between all text lines (something like 2 ^p's, but it's not that). Maybe I have the run thru the file and look for the occasion of double char's and so on.
I#m still onto that, but in here I've got time...
PS
This morning (6 o'clock) running in nice 30 degree C and 65% humidity.
You can apply this procedure after you import your textfile. It can
either remove all multiple line spacing or remove multiple line
spacing from a selected range.
VB/Outlook Guru!VB Code:
Public Sub RemoveMultipleEnters() 'Apply to first paragraph ActiveDocument.Paragraphs(1).LineSpacingRule = wdLineSpaceSingle ' Const = 0 'Or can be applied to a selected paragraph(s) Selection.ParagraphFormat.LineSpacingRule = wdLineSpaceSingle ' Const = 0 End Sub
Thjanks RobDog but it's not the linespacing.
I'll attach a zipped example file.
The thing is, if I create such an example in word, search&replace will do it by deleting (^p^p) with (^p), but it doesn't do it for this special one. We get these files from a specific source, so we have to deal with it.
Ok, got the document. I see what you mean. I will work on it
tomorrow. Time for bed.
Later.
Have a nice rest, we're just starting the day.
Ok, GOT IT!
This will delete the double Enter characters. If its not exatlyVB Code:
Public Sub RemoveMultipleEnters() 'Select the documents contents Application.Documents("Example.doc").Select 'Apply to the selection Do While InStr(1, Selection, Chr(13) & Chr(13)) > 0 Selection.Characters(InStr(1, Selection, Chr(13) & Chr(13))).Delete Loop End Sub
what you need I know that it will only take minimal mods to make
it leave the document as you want (single chr(13)'s or none at all
or ???). Getting the mechanics was the hard part.
HTH
VB/Outlook Guru!
:D
Tausend Dank(in english: Many thanks), I couldn't find which Char that thing was, whow did you do it?
No prob. :)
An Enter Key is a Carriage Return or Chr(13) from the old DOS
days. In Word it displays the Paragraph symbol to represent an
Enter character (if you have that option turned on). Not too much
to it oher than finding and replacing.
Glad to help.
VB/Outlook Guru!