H
Hans List
Hi All,
In order to remove all character formatting, language codes
etc. from all paragraphs I wrote the following macro:
Sub ReplaceParsByPlainText()
Dim aPar As Paragraph
Dim myRange As Range
Dim myText As String
For Each aPar In ActiveDocument.Paragraphs
Set myRange = aPar.Range
'Remove paragraph mark from selection
myRange.SetRange Start:=myRange.Start, _
End:=myRange.End - 1
myText = myRange.Text
aPar.Range.Select
Selection.TypeText myText
Next aPar
End Sub
I presume the line 'Selection.TypeText myText' will probably
be the slowest part.
My question:
- Is this the fastest way to achieve my goal (paragraphs
without character formatting etc.)
Thank you for your suggestions!
Hans List
In order to remove all character formatting, language codes
etc. from all paragraphs I wrote the following macro:
Sub ReplaceParsByPlainText()
Dim aPar As Paragraph
Dim myRange As Range
Dim myText As String
For Each aPar In ActiveDocument.Paragraphs
Set myRange = aPar.Range
'Remove paragraph mark from selection
myRange.SetRange Start:=myRange.Start, _
End:=myRange.End - 1
myText = myRange.Text
aPar.Range.Select
Selection.TypeText myText
Next aPar
End Sub
I presume the line 'Selection.TypeText myText' will probably
be the slowest part.
My question:
- Is this the fastest way to achieve my goal (paragraphs
without character formatting etc.)
Thank you for your suggestions!
Hans List