Hello Guys,
I am running the below Macro for quick password resets for other Attachmate users. I would like to replace the PasswordBox with a TextBox so I can see what I am tiping in. At the moment, because of the PasswordBox field I can only see ****** instead of the User ID.
I am new at this so please note your support is much appreciated.
' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$
Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System is Nothing) Then
Msgbox "Could not create the EXTRA System object. Stopping macro playback."
STOP
End If
Set Sessions = System.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 = 400 ' milliseconds
OldSystemTimeout& = System.TimeoutValue
If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If
' Get the necessary Session Object
Dim Sess0 As Object
Set Sess0 = System.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("Pyrus<Tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("GoIn<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("1<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("x<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("6<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
g_szPassword = PasswordBox("Enter User ID")
Sess0.Screen.Sendkeys(g_szPassword)
Sess0.Screen.Sendkeys("<Enter>")
Begin Dialog HelloDialog 90, 54, "Is User ID Correct?"
'$CStrings Save
OkButton 16, 12, 50, 14
CancelButton 16, 28, 50, 14
'$CStrings Restore
End Dialog
Dim dlgHello as HelloDialog 'Declare the dialog file.
nRet = Dialog(dlgHello)
Select Case nRet 'dlgHello.AllButtons
Case -1 'OKButton
Msgbox "Proceeding with PWD Reset"
Sess0.Screen.Sendkeys("Y<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Pa1>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("qq<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
g_szPassword = PasswordBox("Enter User ID")
Sess0.Screen.Sendkeys(g_szPassword)
Sess0.Screen.Sendkeys("<Tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
g_szPassword = PasswordBox("Re-Enter User ID")
Sess0.Screen.Sendkeys(g_szPassword)
Sess0.Screen.Sendkeys("<Tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
g_szPassword = PasswordBox("Enter New PWD")
Sess0.Screen.Sendkeys(g_szPassword)
Sess0.Screen.Sendkeys("<Enter>")
Case 0 'CancelButton
Msgbox "Password reset canceled"
Sess0.Screen.Sendkeys("N<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Pa1>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("qq<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
End Select
System.TimeoutValue = OldSystemTimeout
End Sub
I am running the below Macro for quick password resets for other Attachmate users. I would like to replace the PasswordBox with a TextBox so I can see what I am tiping in. At the moment, because of the PasswordBox field I can only see ****** instead of the User ID.
I am new at this so please note your support is much appreciated.
' Global variable declarations
Global g_HostSettleTime%
Global g_szPassword$
Sub Main()
'--------------------------------------------------------------------------------
' Get the main system object
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System is Nothing) Then
Msgbox "Could not create the EXTRA System object. Stopping macro playback."
STOP
End If
Set Sessions = System.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 = 400 ' milliseconds
OldSystemTimeout& = System.TimeoutValue
If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If
' Get the necessary Session Object
Dim Sess0 As Object
Set Sess0 = System.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("Pyrus<Tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("GoIn<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("1<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("x<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("6<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
g_szPassword = PasswordBox("Enter User ID")
Sess0.Screen.Sendkeys(g_szPassword)
Sess0.Screen.Sendkeys("<Enter>")
Begin Dialog HelloDialog 90, 54, "Is User ID Correct?"
'$CStrings Save
OkButton 16, 12, 50, 14
CancelButton 16, 28, 50, 14
'$CStrings Restore
End Dialog
Dim dlgHello as HelloDialog 'Declare the dialog file.
nRet = Dialog(dlgHello)
Select Case nRet 'dlgHello.AllButtons
Case -1 'OKButton
Msgbox "Proceeding with PWD Reset"
Sess0.Screen.Sendkeys("Y<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Pa1>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("qq<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
g_szPassword = PasswordBox("Enter User ID")
Sess0.Screen.Sendkeys(g_szPassword)
Sess0.Screen.Sendkeys("<Tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
g_szPassword = PasswordBox("Re-Enter User ID")
Sess0.Screen.Sendkeys(g_szPassword)
Sess0.Screen.Sendkeys("<Tab>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
g_szPassword = PasswordBox("Enter New PWD")
Sess0.Screen.Sendkeys(g_szPassword)
Sess0.Screen.Sendkeys("<Enter>")
Case 0 'CancelButton
Msgbox "Password reset canceled"
Sess0.Screen.Sendkeys("N<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("<Pa1>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.Sendkeys("qq<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
End Select
System.TimeoutValue = OldSystemTimeout
End Sub