Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying part of a session screen. 1

Status
Not open for further replies.

zzxxcc2005

Technical User
Feb 20, 2005
3
US
Presently if I want to copy part of a screen to another application, I have to select the area of the screen, copy and paste text into the target application. I have written a macro that finds the selected area, but when I paste it, none of the <CRLF> are there.

How do I get the <CRLF> into my clipboard?

Here is the code being used now

Dim Buffer As String
Dim objSystem as Object, objSessions as Object, objSession as Object, objScreen as object, abjArea as object

Sub Main
set objSystem = CreateObject("EXTRA.System")
set objSessions = objSystem.Sessions
set objSession = objSessions.Item(1)
Set objScreen = objSession.Screen
Set objArea = objScreen.Selection
Buffer$ = objArea

End Sub
 
What exactly are you trying to move to the other application? I'm always at a loss why everyone is so averse to just getting the data they need with GetString methods.

If you know the location you need, then

MyVariable = Sess0.Screen.GetString(X,Y,Stringlen)

calculus
 
I use GetString in several other macros when x, y, or string length can be determined. I have an macro that will
grab an predetermined area by using GetString in a loop

In this Macro, GetString will not work since the area to be copied will varies randomly .
for example: to respond to an email I want to copy from
position 4,2 to 5,28. Another email I want to copy
position 9,4 to 16,33. For a presentation I want
to copy position 11,6 to 22,49. And so on . . .

Rather then ask each time for the starting and ending point, I would like to select the area as if I was going to do a Edit >> Copy.

Once I have the area selected, I can't get the macro to determine the start and end of the selected area. If I can get the macro to determine the start and end, then I have a subroutine that will put in the CRLF
 
Selection.top and Selection.left should allow the macro to know where the X, Y for the starting position are. Selection.right, selection.bottom will give you the end co-ordinates.

Hope I understand the question.

calculus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top