D
David Turner
In trying to reset font spacing, scaling and position in Word files to remove
extraneous formatting codes once the file is imported into a translation
environment application, this macro:
Sub ScalingSpacingPositionKerning()
Dim rPrg As Paragraph
For Each rPrg In ActiveDocument.Paragraphs
With rPrg.Range.Font
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
End With
Next rPrg
End Sub
for some strange reason, doesn't produce such good result as the one below
which obviously takes much longer to run as it trolls through a S&R on every
character. Can anyone see why this could be?
Sub scaling()
Dim aRange
For Each aRange In ActiveDocument.StoryRanges
With aRange.Find
..ClearFormatting
..Replacement.ClearFormatting
..Format = True
..Replacement.Font.Spacing = 0
..Replacement.Font.scaling = 100
..Execute Forward:=True, Replace:=wdReplaceAll, findText:="^?",
ReplaceWith:="^&"
End With
Next aRange
End Sub
Even going down to:
For Each rWrd In rPrg.Range.Words
or
For Each rChr In rWrd.Characters
doesn't seem to improve matters. The S&R macro on every character still does
better.
I'm mystified.
Any help greatly appreciated.
David
extraneous formatting codes once the file is imported into a translation
environment application, this macro:
Sub ScalingSpacingPositionKerning()
Dim rPrg As Paragraph
For Each rPrg In ActiveDocument.Paragraphs
With rPrg.Range.Font
.Spacing = 0
.Scaling = 100
.Position = 0
.Kerning = 0
End With
Next rPrg
End Sub
for some strange reason, doesn't produce such good result as the one below
which obviously takes much longer to run as it trolls through a S&R on every
character. Can anyone see why this could be?
Sub scaling()
Dim aRange
For Each aRange In ActiveDocument.StoryRanges
With aRange.Find
..ClearFormatting
..Replacement.ClearFormatting
..Format = True
..Replacement.Font.Spacing = 0
..Replacement.Font.scaling = 100
..Execute Forward:=True, Replace:=wdReplaceAll, findText:="^?",
ReplaceWith:="^&"
End With
Next aRange
End Sub
Even going down to:
For Each rWrd In rPrg.Range.Words
or
For Each rChr In rWrd.Characters
doesn't seem to improve matters. The S&R macro on every character still does
better.
I'm mystified.
Any help greatly appreciated.
David