Hi guys,
I'm a newbie and a beginner when it comes to this stuff. I'm using "myExtra Enterprise 7.1a." I need help writing a macro to select certain text in fields on my screen and copy it to the windows clipboard. Where I will then past it into a word document.
My macro is below:
'--------------------------------------------------------------------------------
' This macro was created by the Macro Recorder.
' Session Document: "SESSION1.EDP"
' Date: Thursday, March 15, 2012 18:32:34
' User: c59777
'--------------------------------------------------------------------------------
' 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 = 3000 ' 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
' Selects the text, row column to row column
Sess0.Screen.SelectText 3, 19, 3, 43
' Copy the text
Sess0.Screen.Copy
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
System.TimeoutValue = OldSystemTimeout
End Sub
The section below I actually copy/pasted from another post on this forum:
' Selects the text, row column to row column
Sess0.Screen.SelectText 3, 19, 3, 43
' Copy the text
Sess0.Screen.Copy
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
The reason I did this is because I couldn't find a way to record the selecting of text on the screen. Moving the mouse wouldn't record and pressing shift and the arrow keys also wouldn't record....
I need help trying to do this please! Thanks!
I'm a newbie and a beginner when it comes to this stuff. I'm using "myExtra Enterprise 7.1a." I need help writing a macro to select certain text in fields on my screen and copy it to the windows clipboard. Where I will then past it into a word document.
My macro is below:
'--------------------------------------------------------------------------------
' This macro was created by the Macro Recorder.
' Session Document: "SESSION1.EDP"
' Date: Thursday, March 15, 2012 18:32:34
' User: c59777
'--------------------------------------------------------------------------------
' 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 = 3000 ' 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
' Selects the text, row column to row column
Sess0.Screen.SelectText 3, 19, 3, 43
' Copy the text
Sess0.Screen.Copy
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
System.TimeoutValue = OldSystemTimeout
End Sub
The section below I actually copy/pasted from another post on this forum:
' Selects the text, row column to row column
Sess0.Screen.SelectText 3, 19, 3, 43
' Copy the text
Sess0.Screen.Copy
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
The reason I did this is because I couldn't find a way to record the selecting of text on the screen. Moving the mouse wouldn't record and pressing shift and the arrow keys also wouldn't record....
I need help trying to do this please! Thanks!