Show desktop

  • Thread starter Thread starter James
  • Start date Start date
J

James

Is there a way to duplicate programatically the "show desktop"
shortcut on the quick launch toolbar
 
James,

You can use a macro, tied to a button.

You will need to set a reference to "Microsoft Shell Controls and Automation" which is the file
Shell32.dll.

Sub ShowDesktop()
Dim objShell As Shell
Set objShell = New Shell
objShell.MinimizeAll
Set objShell = Nothing
End Sub

Sub UndoShowDesktop()
Dim objShell As Shell
Set objShell = New Shell
objShell.UndoMinimizeALL
Set objShell = Nothing
End Sub

The UndoShowDesktop will undo the first one programatically....

HTH,
Bernie
MS Excel MVP
 
Bernie Deitrick said:
You can use a macro, tied to a button.

You will need to set a reference to "Microsoft Shell Controls and
Automation" which is the file Shell32.dll.
....

Or you could just run the "Show Desktop.scf" file directly.

Sub toggledesktop()
Shell Environ("COMSPEC") & " /c """ & Environ("APPDATA") & _
"\Microsoft\Internet Explorer\Quick Launch\Show Desktop.scf"""
End Sub

Run it once to minimize all windows and show the desktop, run it again
to restore all windows. Or click on the desktop icon in the Quick
Launch portion of the task bar.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top