Clipboard Question

  • Thread starter Thread starter Mario Reiley
  • Start date Start date
M

Mario Reiley

Hi, Group

I need transfer a listView.Item's data control to Windows Clipboard for
retrive in MS-Excel or another program.

Some Idea , some code, may be WEB site which advisor will be wellcome.

Best Regard
Mario
 
Mario,

This might be difficult depending on the type of data that you want to
place on the clipboard. If it is just a string, then you should be able to
place it on the clipboard no problem and have it pasted into Excel with no
problem.

However, other formats might be more difficult. What kind of data do
you want to place on the clipboard.

Hope this helps.
 
Mario Reiley said:
Hi, Group

I need transfer a listView.Item's data control to Windows Clipboard for
retrive in MS-Excel or another program.

Some Idea , some code, may be WEB site which advisor will be wellcome.

Best Regard
Mario

1. Make a string with HTML-code: this code should describe the data in
an HTML-table
2. Copy the string to the clipboard in HTML-format. To do this, check
out this article I wrote:
http://realdevs.net/default.aspx?tabid=112&type=art&site=34&parentid=11

If you copy it like this, you can paste it in Excel, Word, Outlook,
....

To create the HTML-code, you code should look like this:

System.Text.StringBuilder builder = new System.Text.StringBuilder();
builder.Append("<table>");
for each row in table // pseudo-code
{
builder.Append("<tr>");
for each column in row // pseudo-code
{
builder.Append("<td>");
builder.Append(value); // here comes the value of the specific
cell
builder.Append("</td>");
}
builder.Append("</tr>");
}
builder.Append("</table>");
string html = builder.ToString();
 
Back
Top