I have been getting around this problem like this:
- Copy code from VS into clipboard
- In RJTE, create a new, temporary text document
- Paste the copied VS code into the new document (this removes all colorization)
- Copy the newly cleaned code back into the clipboard
- Close the temporary RJTE document.
- Paste the cleaned code into an Outlook email.
While this works well, it's quite quite repetitive in nature. With that in mind, I created the following simple script to automate the task.
Jeff
Code: Select all
#language C++Script
// Remove the VSS theme colorization from clipboard data and put the cleaned code
// back into the clipboard. This makes it possible to email code snippets without
// them containing the VSS theme colors.
{
// Create a new TXT document
MainApp.NewDocument(".txt");
// Paste the clipboard contents into the new doc
Document.PasteFromClipboard;
// Select the entire document
Document.SelectAll();
// Copy the selection to the clipboard
Document.CopyToClipboard();
// Undo the paste to prevent a "Save?" question on doc close
Document.Undo();
// Close the document (cleaned code is in the clipboard)
Document.Close();
// Add message to the status area.
MainApp.SetStatusText("Cleaned text is in the clipboard.");
}