In an add-in to Visual Studio I want to take copy of the source code in the code window to the Clipboard using the following:
objTextDoc = CType(_applicationObject.ActiveDocument.Object("TextDocument"), TextDocument) Selection = objTextDoc.Selection() Selection.SelectAll() Selection.Copy()
The reason is that Visual Studio copies the source code in RTF format to the clipboard that includessyntax highlighted source code , I need the syntax highlighted code.
I have read so many articles on the internet that say that no application should overwrite the clipboard contents. I tend to agree with that.
If I could find another way to get hold of syntax highlighted code for a projectItem in a VS Project I would prefer not to use the clipboard.
What advice do you guys have?
Joginder Nahil
www.starprinttools.com