B
Benjamino5
I have a batch of strangely corrupted Word files. Most of the paragraph marks
are actually just chr(13) a.k.a. vbCr, not the full combination vbCrLf,
a.k.a. vbCrLf.
This matters because when I save the Word files as RTF (which I have to do),
the chr(13)-only "paragraph marks" just disappear.
I thought I could do a find-and-replace for chr(13), replacing it with the
combo of chr(13) and chr(10), but Word's weird handling of this made it fail.
Instead, I'm going character by character, which takes a very LONG time:
Sub CharTest()
Dim x As Integer
Dim chars As Characters
Set chars = ActiveDocument.Characters
For x = 1 To ActiveDocument.Characters.Count
If chars.Item(x) = Chr(13) Then
chars.Item(x).text = Replace(chars.Item(x), Chr(13), Chr(13) &
Chr(10))
End If
Next x
End Sub
What would be a better way to do this?
Thanks a lot,
Ben
are actually just chr(13) a.k.a. vbCr, not the full combination vbCrLf,
a.k.a. vbCrLf.
This matters because when I save the Word files as RTF (which I have to do),
the chr(13)-only "paragraph marks" just disappear.
I thought I could do a find-and-replace for chr(13), replacing it with the
combo of chr(13) and chr(10), but Word's weird handling of this made it fail.
Instead, I'm going character by character, which takes a very LONG time:
Sub CharTest()
Dim x As Integer
Dim chars As Characters
Set chars = ActiveDocument.Characters
For x = 1 To ActiveDocument.Characters.Count
If chars.Item(x) = Chr(13) Then
chars.Item(x).text = Replace(chars.Item(x), Chr(13), Chr(13) &
Chr(10))
End If
Next x
End Sub
What would be a better way to do this?
Thanks a lot,
Ben