have a peculiar problem happening with a document. When
it converts to rtf (from another format, not important),
it is producing lots of extra spaces between words.
Curious if anyone can provide a simple macro text that
will search through the document for more than one space
sections and replace them with single spaces. Would help
greatly. Thanks.

Boris

Re: macro for spaces needed by Helmut

Helmut
Fri Oct 22 03:40:35 CDT 2004

Hi Boris,
like this:
Sub Makro3()
ResetSearch
With ActiveDocument.Range.Find
' .Text = " {1;}" ' German, Dutch, ;;;;; !
.Text = " {1,}" ' English ,,,,, !
.Replacement.Text = " "
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
ResetSearch
End Sub
Sub ResetSearch()
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
End Sub
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000



Re: macro for spaces needed by Klaus

Klaus
Fri Oct 22 15:23:28 CDT 2004

> ' .Text = " {1;}" ' German, Dutch, ;;;;; !
> .Text = " {1,}" ' English ,,,,, !

You can speed that up a lot if you use
' .Text = " {2;}" ' German, Dutch, ;;;;; !
.Text = " {2,}" ' English ,,,,, !

Single spaces can be left alone, and since they (probably) are very
frequent, the search will be quicker.

Regards,
Klaus


Re: macro for spaces needed by Helmut

Helmut
Fri Oct 22 16:19:56 CDT 2004

Hi Klaus,
>Single spaces can be left alone, and since they (probably) are very
>frequent, the search will be quicker.
got me! I'll remember that!

See you in Munich?
--
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/

Re: macro for spaces needed by Klaus

Klaus
Fri Oct 22 18:09:24 CDT 2004

Cut down the number of possible matches, and you can speed up wildcard
replacements a lot.
Another examples of that: Restrict matches to a single paragraph by using
[!^13]@ instead of the * wildcard, if possible/sensible (and generally
avoid the * wildcard, unless you are sure it will never match a whole lot
of text).

> See you in Munich?
Nov. 26? Yes... looking forward to meet you and the others!

Regards,
Klaus