D
Dave Neve
Hi,
The macro below has an undesirable effect.
___________________________________________________
Sub LowLong()
Dim wordrange As Range, lrange As Range, i As Long, j As Long
Set wordrange = Selection.Range
For i = 1 To wordrange.Characters.Count
Set lrange = wordrange.Characters(i)
Selection.Range.Font.Size = 10
Selection.Range.Underline = wdUnderlineSingle
lrange.Font.Spacing = 5
wordrange.Font.Color = wdColorBrown
Next i
End Sub
___________________________________________________
After I have run it on a selected item (a word), I type in a space and start
to type in the next word.
The undesirable effect is that the macro applies itself to next word as well
as I type it in.
I don't understand how a macro which has already been executed can have an
effect on items typed in after the macro has been run or what to do to stop
it.
Especially as the (i) has already been counted and and the next loop
finished.
Even more surprising for me, I notice that I have the same problem when I
copy and paste in a word which has been preformated. It's formatting
continues to have an effect on subsequent words.
Thanks as always
The macro below has an undesirable effect.
___________________________________________________
Sub LowLong()
Dim wordrange As Range, lrange As Range, i As Long, j As Long
Set wordrange = Selection.Range
For i = 1 To wordrange.Characters.Count
Set lrange = wordrange.Characters(i)
Selection.Range.Font.Size = 10
Selection.Range.Underline = wdUnderlineSingle
lrange.Font.Spacing = 5
wordrange.Font.Color = wdColorBrown
Next i
End Sub
___________________________________________________
After I have run it on a selected item (a word), I type in a space and start
to type in the next word.
The undesirable effect is that the macro applies itself to next word as well
as I type it in.
I don't understand how a macro which has already been executed can have an
effect on items typed in after the macro has been run or what to do to stop
it.
Especially as the (i) has already been counted and and the next loop
finished.
Even more surprising for me, I notice that I have the same problem when I
copy and paste in a word which has been preformated. It's formatting
continues to have an effect on subsequent words.
Thanks as always