0

I have 8 pages of paragraphs with uneven space between words, I mean, sometimes one, sometimes two or three spaces between words. The uneven space intervals were originated from a macro fro word that converts Scripted text into paragraphs. I will put the code at the end

I tried to fix the issue with the font configuration but that just adjust the length of each space and doesn't do much reducing the number of spaces that came from typing the space key or in this case commanding and extra space from the key automatically, So I don't think that the font or paragraph configuration will solve the problem.

What I want is to fix the file by setting a homogeneous or constant number of spaces between words (ex: just one space between words) removing the extra spaces.

Or fixing my macro to prevent this error in the future it would be absolutely helpful as well.

Selection.EndKey Unit:=wdLine
If Selection.Text = vbCr Then Selection.Delete Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=" "
Selection.EndKey Unit:=wdLine
If Selection.Text = vbCr Then Selection.Delete Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=" "
Selection.EndKey Unit:=wdLine
If Selection.Text = vbCr Then Selection.Delete Unit:=wdCharacter, Count:=1
Selection.TypeText Text:=" "

End Sub

what the macros do is to convert scripted text into paragraph going to the end of a line, then typing supr and adding a space, all this without cutting words in the process.

Example of how the macros works:

*Scripted text:

Mark: Hi.

John: Oh Hi Mark.

After the macro: Mark: Hi. John: Oh Hi Mark.*

3
  • 2
    Repeatedly search/replace two spaces with one space until no replacements occur? Commented Jun 8, 2021 at 18:50
  • Or a "replace all" I had not thought of that, thank you
    – Pablo Rojo
    Commented Jun 8, 2021 at 19:22
  • You'll still have to do it repeatedly; I do this sort of replacement in articles sent to me for the magazine I edit, and if I have e.g., three spaces in a row and I only want one, I end up having to do the s/r twice - the first pass takes the three to two, and the second takes it from two to one. Commented Jun 8, 2021 at 19:31

1 Answer 1

0

These do not appear to be "spaces" but rather paragraph or line breaks.

Try first replacing ^p with just a space and repeating as needed. If that does not do it, try replacing ^l with just a space and repeating as needed. Eventually, everything will be in a single paragraph. Then replace two spaces with one and repeat until none are found.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .