激活CorelDRAW窗口焦点 使用 SetFocus 函数,调用系统 WINAPI函数
Public Declare PtrSafe Function SetFocus Lib "user32" (ByVal hWnd As LongPtr) As LongPtr
Public Function Active_CorelWindows()
  SetFocus AppWindow.Handle
End Function

VBA 反选物件代码中添加  Active_CorelWindows 函数,点击按钮后,自动激活CorelDRAW窗口焦点,马上就能用快捷键
Private Sub 反选按钮_Click()
    Dim sr As ShapeRange
    Dim shr As ShapeRange
    Set sr = ActiveSelectionRange
    Set shr = ActivePage.Shapes.All
    If sr.Shapes.Count = 0 Then
        shr.CreateSelection 
    Else
        shr.RemoveRange sr
        shr.CreateSelection 
    End If
    
  
    Active_CorelWindows
    
End Sub