B
BP
Dear Friends,
I'm trying to write a macro that reduces the size of each
chunk of text formatted with a specific font to a percentage
of the font size of that chunk, i.e. if a certain chunk of
text is 18pt Arial it should become 10.5pt Arial (yes I know
18*0.6 = 10.8, but Word apparently rounds down to the
nearest half point, which is good enough for me), if another
chunk is 12pt Arial it should become 7pt (~7.2) and so on.
The macro I've written is as follows:
* Sub Smaller()
* With Selection.Find
* .ClearFormatting
* .Font.Name = "Arial"
* mySize = Selection.Font.Size
* With .Replacement
* .Font.Size = mySize * 0.6
* End With
* .Execute Replace:=wdReplaceAll, Forward:=True, _
* Wrap:=wdFindContinue
* End With
* End Sub
It does wrong in that it sets all text formatted in Arial to
..6 times the size of the first character in the document --
regardless of what font it is. Can someone tell me how to
correct this?
TIA,
/BP
I'm trying to write a macro that reduces the size of each
chunk of text formatted with a specific font to a percentage
of the font size of that chunk, i.e. if a certain chunk of
text is 18pt Arial it should become 10.5pt Arial (yes I know
18*0.6 = 10.8, but Word apparently rounds down to the
nearest half point, which is good enough for me), if another
chunk is 12pt Arial it should become 7pt (~7.2) and so on.
The macro I've written is as follows:
* Sub Smaller()
* With Selection.Find
* .ClearFormatting
* .Font.Name = "Arial"
* mySize = Selection.Font.Size
* With .Replacement
* .Font.Size = mySize * 0.6
* End With
* .Execute Replace:=wdReplaceAll, Forward:=True, _
* Wrap:=wdFindContinue
* End With
* End Sub
It does wrong in that it sets all text formatted in Arial to
..6 times the size of the first character in the document --
regardless of what font it is. Can someone tell me how to
correct this?
TIA,
/BP