A
avkokin
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
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