Code Examples For RunCommand Constants

Amend AutoCorrect Settings

acCmdInsertHyperlink

The following code opens the AutoCorrect Dialog box.

'***************** Code Start *******************
'Original code by Terry Wickenden

Private Sub cmdAutoCorrect_Click()
    On Error GoTo ErrAutoCorrect
    
    DoCmd.RunCommand acCmdAutoCorrect
    Exit Sub

ErrAutoCorrect:
    Select Case Err
        Case 2046
            'Command not available
            MsgBox "AutoCorrect is not available at this time.", vbCritical, "Not Available"
        Case 2501
            'Cancel selected in dialog box - do nothing
        Case Else
            MsgBox Err.Number & ":-" & vbCrLf & Err.Description
    End Select
    
End Sub

'****************** Code End ********************