There is a document Word (see example: http://www.box.net/shared/luo0o336so).
Some sentenses in paragraphs are broken off by paragraph signs, other
paragraphs is ok.
The problem - I need to join the broken of lines of each paragraph,
but thus not uniting normal paragraphs.
The end of the normal paragraph consists of a point and a paragraph
sign.
The end of a line of the broken off paragraph consists of a paragraph
sign.
Here the code which I try to use, but has stopped on replacement
operation. Correct me please and explain what is my wrong. Thanks.
Code:

Sub delpar_3()
Dim sPar As String
Dim par As Paragraph
Dim i As Integer
i = 0
For Each par In ActiveDocument.Paragraphs
If Right(par, 2) = Chr(46) & Chr(13) Then
i = i + 1
Else
If Right(par, 1) = Chr(13) Then
par = Replace(par, Chr(13), " ") 'Here is error!!!
End If
Next par
End Sub

RE: How to change sign of paragraph on the space? by HelmutWeber

HelmutWeber
Wed May 14 06:56:03 PDT 2008

Hi Anton,

like that:

Sub delpar_3()
Dim sPar As String
Dim par As Paragraph
Dim i As Integer
i = 0
For Each par In ActiveDocument.Paragraphs
If Right(par, 2) = Chr(46) & Chr(13) Then
i = i + 1
Else
If Right(par, 1) = Chr(13) Then
par.Range.Text = Replace(par.Range.Text, Chr(13), " ") 'Here is
error!!!
End If
End If
Next par
End Sub

--
Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
Word 2002, Windows XP (german versions)

Re: How to change sign of paragraph on the space? by avkokin

avkokin
Wed May 14 11:44:59 PDT 2008

On May 14, 5:56=A0pm, Helmut Weber
<HelmutWe...@discussions.microsoft.com> wrote:
> Hi Anton,
>
> like that:
>
> Sub delpar_3()
> Dim sPar As String
> Dim par As Paragraph
> Dim i As Integer
> i =3D 0
> For Each par In ActiveDocument.Paragraphs
> =A0 =A0If Right(par, 2) =3D Chr(46) & Chr(13) Then
> =A0 =A0 =A0 =A0i =3D i + 1
> =A0 =A0Else
> =A0 =A0 =A0 If Right(par, 1) =3D Chr(13) Then
> =A0 =A0 =A0 =A0 =A0par.Range.Text =3D Replace(par.Range.Text, Chr(13), " "=
) 'Here is
> error!!!
> =A0 =A0 =A0 End If
> =A0 =A0End If
> Next par
> End Sub
>
> --
> Greetings from Bavaria, Germany
> Helmut Weber, MVP WordVBA
> Word 2002, Windows XP (german versions)

Thank you very much. It's work!