Reflection Desktop VBA Guide
Attachmate.Reflection.Objects.Emulation.IbmHosts Library / Attachmate.Reflection.Objects.Emulation.IbmHosts Library / IbmScreen Object / PasteRange Method
The starting row coordinate for the first screen.
The starting column coordinate for the first screen.
The ending row coordinate for the first screen.
The ending column coordinate for the first screen.
The starting row coordinate for the remaining screens.
The starting column coordinate for the remaining screens.
The ending row coordinate for the remaining screens.
The ending column coordinate for the remaining screens.
The ControlKeyCode Enumeration value that specifies the terminal key to use to scroll to the second and remaining screens in the paste range.
Determines what happens when a line of text being copied exceeds the current line length. If this value is true, the remaining text in the line is pasted at the start of the next field. If it is false, the current line is truncated and the next line is pasted at the start of the next field.
Controls how text is pasted when the screen contains protected locations. If false, pasting stops if the first field on a row is protected. If true, the method continues to search for subsequent fields, searching first right and then down, until it finds another unprotected field. If an unprotected field is located, pasting starts in this field; if not, pasting stops. When pasting is stopped, any remaining text is put into the PasteNext buffer.
Example
In This Topic
    PasteRange Method
    In This Topic

    Pastes the contents of the Clipboard to a defined region of the current screen and, if needed, regions of subsequent screens in the host application.

    Syntax
    expression.PasteRange( _
       ByVal top As Integer, _
       ByVal left As Integer, _
       ByVal bottom As Integer, _
       ByVal right As Integer, _
       ByVal remTop As Integer, _
       ByVal remLeft As Integer, _
       ByVal remBottom As Integer, _
       ByVal remRight As Integer, _
       ByVal keycode As ControlKeyCode, _
       ByVal wrapText As Boolean, _
       ByVal useFieldDelim As Boolean _
    ) 
    where expression is a variable that represents a IbmScreen Object

    Parameters

    top
    The starting row coordinate for the first screen.
    left
    The starting column coordinate for the first screen.
    bottom
    The ending row coordinate for the first screen.
    right
    The ending column coordinate for the first screen.
    remTop
    The starting row coordinate for the remaining screens.
    remLeft
    The starting column coordinate for the remaining screens.
    remBottom
    The ending row coordinate for the remaining screens.
    remRight
    The ending column coordinate for the remaining screens.
    keycode
    The ControlKeyCode Enumeration value that specifies the terminal key to use to scroll to the second and remaining screens in the paste range.
    wrapText
    Determines what happens when a line of text being copied exceeds the current line length. If this value is true, the remaining text in the line is pasted at the start of the next field. If it is false, the current line is truncated and the next line is pasted at the start of the next field.
    useFieldDelim
    Controls how text is pasted when the screen contains protected locations. If false, pasting stops if the first field on a row is protected. If true, the method continues to search for subsequent fields, searching first right and then down, until it finds another unprotected field. If an unprotected field is located, pasting starts in this field; if not, pasting stops. When pasting is stopped, any remaining text is put into the PasteNext buffer.
    Remarks

    A paste range defines a screen region in which you can paste text across multiple screens after you cut, copy, or append a selection on the Clipboard.

    Users can define and use paste ranges with the Paste Range dialog box but the screen positions and other settings are not saved when they close their sessions. Creating a macro with the PasteRange method allows you to define and save a custom paste range that is tailored for an application.

    Before you create a paste range macro, consider defining and testing a range with the Paste range dialog box first. Then use the settings in the dialog box for your macro. After you create a Paste Range macro, users can run it to paste into the custom screen region without needing to configure the paste range every time they open their session.

    More about the parameters...

    The parameters define the region in the host screen(s) to be used for the paste operation, the terminal key used to scroll to subsequent screens, and how word wrap and field delimiters are handled.

    Values for the screen position arguments that define text regions can be positive, zero, or negative. Positive row values are counted down from the top of the screen, zero is the last row on the screen, and negative values are counted up from the last row. Positive column arguments are counted from the left edge of the screen, zero is the last column on the screen, and negative values are counted back from the last column. For example, to start pasting on the first screen at the upper-left corner of the screen, set top = 1 and left = 1. To end pasting at the lower-right corner of the screen, set bottom = 0 and right = 0.

    Example
    This example pastes text into a screen region starting at row 5 and column 18 and ending at the lower right-hand corner of the first screen. For subsequent screens, text is pasted into a region starting at row 5 and column 18 and ending 4 rows from the last row and 5 columns from the last column. The PF8 key is used to page down and text wrap is on. If the first field on a line is a protected field, the line is pasted into the first available unprotected field.
    Sub pasteMyData()
        ThisIbmScreen.PasteRange 5, 18, 0, 0, 5, 18, -4, -5, ControlKeyCode_F8, True, True
    End Sub
    See Also