How to show / hide Object Manager in CorelDRAW X3, X5 via macro activated with F9 hotkey or from Command Button on custom form. I present a solution based on SendKeys. I am asking the community for a better solution to the problem via VBA if possible.

BG
Как да покажа / скрия Object Manager в CorelDRAW X3, X5 чрез макрос, активиран с горещ главиш F9 или от Command Button на потребителска форма. Това е проблем, който ме занимава от дълго време.

Представям едно решение, в основата на което е SendKeys. Моля общността за по-добро решение на проблема чрез VBA, ако е възможно.

EN
How to show / hide Object Manager in CorelDRAW X3, X5 via macro activated with F9 hotkey or from Command Button on custom form. This is a problem that has been bothering me for a long time. I present a solution based on SendKeys. I am asking the community for a better solution to the problem via VBA if possible.

Private Sub CommandButton31_Click()

'SHOW OBJECT MANAGER

'AVOID send ALT{TAB} = %{TAB}

'AVOID send {ENTER}

'AVOID send any letter char if use multilyngual or not ENG PC system

'or use with caution

'WHEN USE SendKeys

'SendKeys is not for dummies use

 

'Application.VBE.MainWindow.Visible = False

 

With AppWindow

WIND_STATE = .WindowState

.Activate

.WindowState = WIND_STATE

End With

'AppWindow.Activate

 

Dim WshShell As Object

Set WshShell = CreateObject("WScript.Shell")

WshShell.SendKeys "%{UP}%" 'MUST BE ACTIVE ROW TO WORK THE COMMAND ROWS BELOW. ACTIVATE MainMenu

WshShell.SendKeys "{TAB 8}", True 'SHOW TOOLS MENU

WshShell.SendKeys "{DOWN}", True 'EXPAND TOOLS MENU

'WshShell.SendKeys "^n", True 'SHOW/HIDE OBJECT MANAGER

WshShell.SendKeys "{DOWN 4}" & Chr(32), True

End Sub

Three important recommendations for using SendKeys

  1. AVOID send ALT{TAB} = %{TAB}
  2. AVOID send {ENTER}
  3. AVOID send any letter char if use multilyngual or not ENG PC system

or use with caution

WHEN USE SendKeys

SendKeys is not for dummies use

 

Greetings!