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!

Parents
  • You could have a look at these:

    Sub ShowOrHideShow_Object_Manager()
    
        If Application.FrameWork.IsDockerVisible("73675757-b6d9-44fb-87b8-f86089d94e87") = False Then
            Application.FrameWork.ShowDocker "73675757-b6d9-44fb-87b8-f86089d94e87"
        Else
            Application.FrameWork.HideDocker "73675757-b6d9-44fb-87b8-f86089d94e87"
            Application.FrameWork.ShowDocker "73675757-b6d9-44fb-87b8-f86089d94e87"
        End If
    End Sub
    
    Sub Hide_Object_Manager()
    
        If Application.FrameWork.IsDockerVisible("73675757-b6d9-44fb-87b8-f86089d94e87") = True Then
            Application.FrameWork.HideDocker "73675757-b6d9-44fb-87b8-f86089d94e87"
        End If
    End Sub
    

    If the docker is already visible, but is "behind" other dockers that are nested in one docker area, then just "showing" it may not be enough. That is why the "ShowOrHideShow" sub first hides, then shows the docker. That makes sure that the docker is brought "to the front".

Reply Children
No Data