W
ward
Hi,
I've run into the following annoying, stupid issue:
Using VBA I want to do a search for 2 or more empty
paragraphs and replace them by one paragraph. Therefore I
use the following code:
With tDoc.Range.Find
.ClearFormatting
.Text = "^13{2,}" <----- problem
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
The line ".text = "^13{2,}"" is giving me problems
however. Because the comma is a list seperator, as defined
in my MS Windows regional settings dialog box (Start,
control panel, regional settings, numbers), it works fine
on my computer.
But a colleague has his list seperator set to ";". Thus,
Word pops up saying it is not a valid expression.
I want my program to work, regardless of the regional
settings. So i tried to find a variable or constant which
contains the list seperator character (be it ",", ";" or
whatever) and create the .text string accordingly; but I
didn't find any.
Any (other) solutions,
thanks
Ward
I've run into the following annoying, stupid issue:
Using VBA I want to do a search for 2 or more empty
paragraphs and replace them by one paragraph. Therefore I
use the following code:
With tDoc.Range.Find
.ClearFormatting
.Text = "^13{2,}" <----- problem
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
The line ".text = "^13{2,}"" is giving me problems
however. Because the comma is a list seperator, as defined
in my MS Windows regional settings dialog box (Start,
control panel, regional settings, numbers), it works fine
on my computer.
But a colleague has his list seperator set to ";". Thus,
Word pops up saying it is not a valid expression.
I want my program to work, regardless of the regional
settings. So i tried to find a variable or constant which
contains the list seperator character (be it ",", ";" or
whatever) and create the .text string accordingly; but I
didn't find any.
Any (other) solutions,
thanks
Ward