المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to set formatted html to the clipboard



C# Programming
10-28-2009, 02:21 AM
Hi, i want to set formatted Html to the clipboard using c#. The formatted html contains colored texts,
tables etc. What i wrote is:

DataObject dataObject = new DataObject();
dataObject.SetData(DataFormats.Html, true, htmlString);
Clipboard.SetDataObject(dataObject);

Then i ran the program and tried to paste the data in MSWord. But nothing is pasted. If i set DataFormats.Text, then data is pasted without any problem. But this time only the whole html string with tags are pasted as plain text. I want formatted html.

So how can i do that?

Thanks in advance.