I am having trouble pasting data from my OLE object below.
The code logs in to an application, goes into a certain screen
and then from a certain position to another it copies text, which is not in any format whatsoever.
here is an example:
SPECIAL BROKER PULL 0 0 0
UNIDENTIFIED PIECES 2 15 14
CANADA 16 66 51
FOREIGNS 67 979 913
FIRST CLASS SINGLES 0 0 0
FIRST CLASS MULTIS 0 0 0
FRFC 980 1,383 404
FIVE DIGIT MULTIES 0 0 0
NINE DIGIT MULTIES 0 0 0
FIVE DIGIT PRESORT 0 0 0
NINE DIGIT PRESORT 1,384 37,962 36,579
these values are not in cells/tables. I would like to automate pasting this info into a textbox so that i can later
grab: ex. Nine Digit Presort - 36579.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Option Compare Database
Public Sub Command4_Click()
Dim DataFromProxyPlus As String
Dim hostpassword As String
Dim Session As Object
Dim Selection As Object
Dim CopyData
Const SessionCon = "149.83.123.3"
Set Session = CreateObject("ReflectionIBM.Application")
With Session
.Visible = True
.SetupSession rc3270Terminal, rc3270MODEL2E, rcTelnet
.Hostname = "149.83.123.3"
.Connect
If .KeyboardLocked = 0 Then
.Connect
.WaitForEvent rcEnterPos, "30", "0", 5, 5
.TransmitANSI "prxy"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "1", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 1, 1
.TransmitTerminalKey rcIBMClearKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 1, 1
.Wait (1)
.TransmitANSI "cesn"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 10, 26
.WaitForDisplayString ".", "30", 10, 24
.TransmitANSI "tbyolmo"
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.Wait (1)
hostpassword = "eq013342"
.TransmitANSI hostpassword
.TransmitTerminalKey rcIBMEnterKey
Else
.StopMacro
Exit Sub
End If
.WaitForEvent rcEnterPos, "30", "0", 24, 76
.WaitForDisplayString "NO.-->", "30", 24, 69
.TransmitANSI "66"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 8, 54
.WaitForDisplayString "2-CANADIAN..>", "30", 8, 39
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcEnterPos, "30", "0", 13, 33
.WaitForDisplayString "NUMBER....>", "30", 13, 20
.TransmitANSI "n44689010"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 8, 2
.TransmitTerminalKey rcIBMPf4Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 3, 22
.WaitForDisplayString "JOB................", "30", 3, 2
.TransmitTerminalKey rcIBMPf6Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 3, 10
.WaitForDisplayString "NO.", "30", 3, 6
.TransmitTerminalKey rcIBMPf5Key
.SetSelectionStartPos 7, 5
' .WaitForEvent rcEnterPos, "30", "0", 7, 5
' .WaitForDisplayString "2", "30", 7, 3
.ExtendSelectionRect 17, 67
.CopySelection
CopyData = .Paste
End With
TextBox = CopyData ' needs fix
Set Session = Nothing
End Sub
The code logs in to an application, goes into a certain screen
and then from a certain position to another it copies text, which is not in any format whatsoever.
here is an example:
SPECIAL BROKER PULL 0 0 0
UNIDENTIFIED PIECES 2 15 14
CANADA 16 66 51
FOREIGNS 67 979 913
FIRST CLASS SINGLES 0 0 0
FIRST CLASS MULTIS 0 0 0
FRFC 980 1,383 404
FIVE DIGIT MULTIES 0 0 0
NINE DIGIT MULTIES 0 0 0
FIVE DIGIT PRESORT 0 0 0
NINE DIGIT PRESORT 1,384 37,962 36,579
these values are not in cells/tables. I would like to automate pasting this info into a textbox so that i can later
grab: ex. Nine Digit Presort - 36579.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Option Compare Database
Public Sub Command4_Click()
Dim DataFromProxyPlus As String
Dim hostpassword As String
Dim Session As Object
Dim Selection As Object
Dim CopyData
Const SessionCon = "149.83.123.3"
Set Session = CreateObject("ReflectionIBM.Application")
With Session
.Visible = True
.SetupSession rc3270Terminal, rc3270MODEL2E, rcTelnet
.Hostname = "149.83.123.3"
.Connect
If .KeyboardLocked = 0 Then
.Connect
.WaitForEvent rcEnterPos, "30", "0", 5, 5
.TransmitANSI "prxy"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "1", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 1, 1
.TransmitTerminalKey rcIBMClearKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 1, 1
.Wait (1)
.TransmitANSI "cesn"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 10, 26
.WaitForDisplayString ".", "30", 10, 24
.TransmitANSI "tbyolmo"
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.Wait (1)
hostpassword = "eq013342"
.TransmitANSI hostpassword
.TransmitTerminalKey rcIBMEnterKey
Else
.StopMacro
Exit Sub
End If
.WaitForEvent rcEnterPos, "30", "0", 24, 76
.WaitForDisplayString "NO.-->", "30", 24, 69
.TransmitANSI "66"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 8, 54
.WaitForDisplayString "2-CANADIAN..>", "30", 8, 39
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcEnterPos, "30", "0", 13, 33
.WaitForDisplayString "NUMBER....>", "30", 13, 20
.TransmitANSI "n44689010"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 8, 2
.TransmitTerminalKey rcIBMPf4Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 3, 22
.WaitForDisplayString "JOB................", "30", 3, 2
.TransmitTerminalKey rcIBMPf6Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 3, 10
.WaitForDisplayString "NO.", "30", 3, 6
.TransmitTerminalKey rcIBMPf5Key
.SetSelectionStartPos 7, 5
' .WaitForEvent rcEnterPos, "30", "0", 7, 5
' .WaitForDisplayString "2", "30", 7, 3
.ExtendSelectionRect 17, 67
.CopySelection
CopyData = .Paste
End With
TextBox = CopyData ' needs fix
Set Session = Nothing
End Sub