To be able to use it in all Word files, you can work directly in the normal.dotm template. Thus, insert the following code in the Modules section.
1 2 3 |
Sub CondensExpandFont() UserForm3.Show vbModeless ' Afisează UserForm-ul modal End Sub |
Also in the VBA working mode, we will insert a form (UserForm), then we will insert a ListBox type control, where we will add the following range of values, which we would be interested in.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Private Sub UserForm_Initialize() With ListBox1 .AddItem "-0.30" .AddItem "-0.25" .AddItem "-0.20" .AddItem "-0.15" .AddItem "-0.10" .AddItem "0" .AddItem "0.10" .AddItem "0.15" .AddItem "0.20" .AddItem "0.25" .AddItem "0.30" End With End Sub |
We will take the value from the ListBox and act instantly, so it will be able to choose according to what would be useful.
1 2 3 4 5 6 |
Private Sub ListBox1_Click() If ListBox1.ListIndex <> -1 Then Selection.Font.Spacing = Val(ListBox1.Value) ' Unload Me ' ar inchide formularul după fiecare alegere End If End Sub |
Afterwards, a button can be created in the Quick Access Toolbar (QAT) by choosing the macro and customizing the details so that it is as friendly as possible.