Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have webbrowser control in winform.In that control a html page is loaded.If I copy that page by selecting all(ctrl+a then ctrl+c) and paste to a word file,the file is structured fine with all the images and styles of that page.

Now see the codes....................

webBrowser1.Document.ExecCommand("SelectAll", true, null);
webBrowser1.Document.ExecCommand("Copy", true, null);

These codes are selecting and copying the content of the control to clipboard.If I then open a word document and paste it by ctrl+v that is working fine.

Now, copy option is done by code (above code),so I want the paste(ctrl+v) option by c# code.
Posted

1 solution

Please see the class System.Windows.Forms.Clipboard:
http://msdn.microsoft.com/en-us/library/system.windows.forms.clipboard%28v=vs.110%29.aspx[^].

But it looks like you are trying to move data in your software through the clipboard. This is a kind of abuse. You should not touch the clipboard (unless this is the purpose of the command), because the user may depend on its content, say, using some other applications.

—SA
 
Share this answer
 
Comments
souvikcode 2-Sep-14 9:46am    
yes,you are right.but is there any c# code to paste ?
Sergey Alexandrovich Kryukov 2-Sep-14 11:39am    
On the save very page referenced above. Did you even read this piece of documentation? Everything is explained.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900