Back in Word 6 I had a macro that did this, but then when the newer versions came out, it didn’t work anymore, and I’ve never gotten it to work since. A couple of years ago, someone posted an answer to this, but it didn’t work.
Here’s what I’d like to get back:
a single macro (which I would make an icon for and put it in my toolbar) with 4 functions:
1) click it and it would change Paragraph | Line Spacing to single
2) shift-click it and it would change line spacing to solid–so if the text for that paragraph was size 40, the line spacing would be changed to Exactly 40, or if text was size 24, line spacing would change to exactly 24.
3) control-shift click on the icon to reduce the line spacing by 1 point (exactly 24 down to exactly 23, etc)
4) control-click on the icon to increase the line spacing by 1 point
Right now I have 2 separate macros for this, but of the 4 possibilities between them, only 1 works. Here is the macro text that someone sent me earlier to increase-decrease by 1 point (it doesn’t work)
Dim xx
Dim FP As Object: Set FP = WordBasic.DialogRecord.FormatParagraph(False)
Dim FF As Object: Set FF = WordBasic.DialogRecord.FormatFont(False)
WordBasic.CurValues.FormatParagraph FP
WordBasic.CurValues.FormatFont FF
Rem *** this section checks if line spacing is set for points,
Rem *** if not changes it to points ****
xx = WordBasic.Val(FP.LineSpacing)
If xx = 0 Then
xx = WordBasic.Val(FF.Points) * 1.2
End If
Rem ***** GetAsyncKeyState(16) checks on status of shift key. If it
Rem ***** changes, then it toggles from + to –
If GetAsyncKeyState(16) < 0 Then
WordBasic.FormatParagraph LineSpacingRule:=4, LineSpacing:=xx – 1
Else
WordBasic.FormatParagraph LineSpacingRule:=4, LineSpacing:=xx + 1
End If
End Sub
===============================================
Here is the macro to switch from Single Line Spacing to Solid. If the spacing is set to anything other than Single, then clicking this icon DOES set the spacing back to Single. But the part to change to Solid never works.
Dim xx
Dim FF As Object: Set FF = WordBasic.DialogRecord.FormatFont(False)
WordBasic.CurValues.FormatFont FF
xx = WordBasic.Val(FF.Points)
If GetAsyncKeyState(16) < 0 Then
WordBasic.FormatParagraph LineSpacingRule:=0, LineSpacing:=""
Else
WordBasic.FormatParagraph LineSpacingRule:=4, LineSpacing:=xx
End If
===================================
Can anyone spot the errors? and hopefully combine them in to 1 macro