View Single Post
 
Old 11-22-2011, 04:26 AM
tinfanide tinfanide is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2011
Posts: 312
tinfanide is on a distinguished road
Default Word VBA: How to create a command button and trigger a function?

Code:
Private Sub CommandButton1_Click()

Selection.Font.Color = wdColorRed

End Sub
I couldn't link the command button with the below codes.
How can I create a command button to do the things below?

Code:
Selection.Font.Color = wdColorRed
    Selection.Font.Bold = wdToggle
    If Selection.Font.Underline = wdUnderlineNone Then
        Selection.Font.Underline = wdUnderlineSingle
    Else
        Selection.Font.Underline = wdUnderlineNone
    End If
Reply With Quote