views:

159

answers:

1

Hi,

When a user selects and copies a text from a web page, I need to get that text with all the html tags included so that I can select some specific attributes etc.

Is it possible to read it from .NET application?

thanks

+1  A: 

The Clipboard.GetText method will retrieve HTML content from the clipboard:

var htmlData = System.Windows.Clipboard.GetText(System.Windows.TextDataFormat.Html);

You can check if the clipboard contains HTML with the Clipboard.ContainsText method.

Phil Ross