Sparky1157
Programmer
I've been using the Macro Editor to create some automation in our Reflection sessions, but now I would also like to create a macro that will turn off the Navigation Pane for a particular folder that's opened on my desktop (the folder containing links to my macros). Here's the code I have so far...
====================
' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$
Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
Dim Sessions As Object
Dim Explorer As Object
Set Explorer = CreateObject("Explorer.Application")
If (Explorer is Nothing) Then
Msgbox "Could not create the Explorer System object. Stopping macro playback."
STOP
End If
Set Sessions = Explorer.Sessions
If (Sessions is Nothing) Then
Msgbox "Could not create the Sessions collection object. Stopping macro playback."
STOP
End If
'--------------------------------------------------------------------------------
' Set the default wait timeout value
g_HostSettleTime = 100 ' milliseconds
' Get the necessary Session Object
Dim Sess0 As Object
Set Sess0 = Explorer.ActiveSession
If (Sess0 is Nothing) Then
Msgbox "Could not create the Session object. Stopping macro playback."
STOP
End If
If Not Sess0.Visible Then Sess0.Visible = TRUE
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
' This section of code contains the recorded events
Sess0.Screen.Sendkeys("<Alt+D>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Tab><Tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Down>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("l")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("n")
End Sub
====================
...but I have no idea how to properly select the folder window and how to establish it as the appropriate SESSION to send the keystrokes to.
Some help would be greatly appreciated!
Thanks in advance!!!
I also tried the following, without success:
====================
Sub Main()
Dim Explorer As Object
Set Explorer = GetObject("Explorer.Application.1")
If Explorer is Nothing Then
Msgbox "Could not find Windows Explorer Window."
STOP
End If
Explorer.Screen.Sendkeys("<Alt+D>")
Explorer.Screen.WaitHostQuiet(g_HostSettleTime)
Explorer.Screen.Sendkeys("<Tab><Tab>")
Explorer.Screen.WaitHostQuiet(g_HostSettleTime)
Explorer.Screen.Sendkeys("<Down>")
Explorer.Screen.WaitHostQuiet(g_HostSettleTime)
Explorer.Screen.Sendkeys("l")
Explorer.Screen.WaitHostQuiet(g_HostSettleTime)
Explorer.Screen.Sendkeys("n")
End Sub
====================
====================
' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$
Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
Dim Sessions As Object
Dim Explorer As Object
Set Explorer = CreateObject("Explorer.Application")
If (Explorer is Nothing) Then
Msgbox "Could not create the Explorer System object. Stopping macro playback."
STOP
End If
Set Sessions = Explorer.Sessions
If (Sessions is Nothing) Then
Msgbox "Could not create the Sessions collection object. Stopping macro playback."
STOP
End If
'--------------------------------------------------------------------------------
' Set the default wait timeout value
g_HostSettleTime = 100 ' milliseconds
' Get the necessary Session Object
Dim Sess0 As Object
Set Sess0 = Explorer.ActiveSession
If (Sess0 is Nothing) Then
Msgbox "Could not create the Session object. Stopping macro playback."
STOP
End If
If Not Sess0.Visible Then Sess0.Visible = TRUE
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
' This section of code contains the recorded events
Sess0.Screen.Sendkeys("<Alt+D>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Tab><Tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Down>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("l")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("n")
End Sub
====================
...but I have no idea how to properly select the folder window and how to establish it as the appropriate SESSION to send the keystrokes to.
Some help would be greatly appreciated!
Thanks in advance!!!
I also tried the following, without success:
====================
Sub Main()
Dim Explorer As Object
Set Explorer = GetObject("Explorer.Application.1")
If Explorer is Nothing Then
Msgbox "Could not find Windows Explorer Window."
STOP
End If
Explorer.Screen.Sendkeys("<Alt+D>")
Explorer.Screen.WaitHostQuiet(g_HostSettleTime)
Explorer.Screen.Sendkeys("<Tab><Tab>")
Explorer.Screen.WaitHostQuiet(g_HostSettleTime)
Explorer.Screen.Sendkeys("<Down>")
Explorer.Screen.WaitHostQuiet(g_HostSettleTime)
Explorer.Screen.Sendkeys("l")
Explorer.Screen.WaitHostQuiet(g_HostSettleTime)
Explorer.Screen.Sendkeys("n")
End Sub
====================