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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clipboard()

Status
Not open for further replies.

squivy

Programmer
Jun 1, 2004
6
US
I am trying to copy 3 columns from a grid datawindow to the clipboard to use to paste to Excel

When I run through this code:
DO WHILE lv_l_row > 0

// Concatenate all selected fields into one string to be put into the
// clipboard. Within a row, fields are delimited by tabs. Rows are
// delimited by carriage control/line feed.
//These local variables are set above
lv_s_line = &
lv_s_acct_nbr + &
lv_s_tab + &
lv_s_dept_nbr + &
lv_s_tab + &
lv_s_pct + &
gv_str_const.crlf

//Make sure the lv_s_line is not null. If it is then skip it. The reason for this is because if it is null then it will blank out lv_s_copy_string
//of all existing values.
IF NOT(IsNull(lv_s_line)) THEN
lv_s_copy_string = lv_s_copy_string + lv_s_line
END IF

// Get next selected row
lv_l_row = lv_dw_list.GetSelectedRow(lv_l_row)

LOOP

Clipboard(lv_s_copy_string)

I can see that lv_s_copy_string contains the data that I want copied to the clipboard, but when I try pasting the contents of the clipboard into Excel, nothing is pasted.
Is there something that I am forgetting to do to copy the data I want to the clipboard? I have also tried using Super::Clipboard("").. Any help would be appreciated!!!
 
If you add a statement like:

ls_test = clipboard()

after "Clipboard(lv_s_copy_string)"

does ls_test contain a value?
 
I added that line - ls_test does not contain a value
 
When I step through it, lv_s_copy_string contains data that looks like this
lv_s_copy_string = "50304|90100|50||"


Is there any special property I need to set to enable copy to clipboard functionality?
 
I figured this out - since I was trying to copy to clipboard from a datawindow, I need to preface the call to Clipboard() with ::Clipboard() - otherwise I was copying a default non-text bitmap (the information icon) to the clipboard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top