Home » Questions » Computers [ Ask a new question ]

Can I paste plain text by default?

Can I paste plain text by default?

I regularly copy and paste text between spreadsheets, emails, browser windows, etc. I can't think of a single time when I've wanted to keep the formatting from the source text.

Asked by: Guest | Views: 350
Total answers/comments: 5
Guest [Entry]

"Unfortunately, no. And I believe this is by design.

The issue is that the Windows clipboard does not have to store the data. It is effectively a clearing house where any application can list the data that was just copied (or cut) and offer it up to any application (including itself) to be pasted. The clipboard contains a list of formats in which the data is available, and if the application chooses to do so, the data itself in some of those formats.

The application that processes a Paste operation then has the option to choose the data format that best suits it. Some applications (e.g. Notepad) will only accept one particular format (such as plain text) and simply do nothing if that format is not available. Others pick a preferred format by default but provide a UI for choosing among alternatives that can be understood by that application.

In principle a program could be written that monitors the clipboard for new content and flattens any non-text content to just plain text. There is an event available to notify such a monitor of new content on the clipboard. However, I suspect that implementing such a thing would break a fair number of programs, and possibly in surprising ways.

The simple workaround in stock XP is to use Notepad to flatten the data when needed, or to use one of the many tools that improve the clipboard by implementing a stack, providing a view of its content, and so forth.

If you want to try building a tool yourself, might benefit from this question over at SO, and its related questions...."
Guest [Entry]

"There is not way to do this by default, but with a bit of hackery, we can work around that.

You will need:

PlainTextClipboard
AutoIT Script (you can use AutoHotKey, I just don't know that scripting language)

Create an AutoIt Script with the following code:

$ptcPath = ""C:\Program Files (x86)\Plain Text Clipboard\PlainTextClipboard.exe""
HotKeySet(""^v"", ""PastePlainText"")

While True ;Keep it running indefinitely.
WEnd
HotKeySet(""^v"") ;unregister the hotkey

Func PastePlainText()
Run($ptcPath);
Send(ClipGet())
EndFunc

When you press Ctrl + V, this will run the PlainTextClipboard program, then send the contents of your clipboard to the current window. Unfortunately, it will send the contents one character at a time, so it is a bit slow. It's a problem I'm working on, but it should serve as a reasonable start. If there are any AutoHotKey/AutoIT gurus out there, feel free to make your own version of this script. I'll update it as soon as I figure out how to solve the problem."
Guest [Entry]

"Direct answer. No.

There is no control of the standard clipboard in Windows. This is the reason a lot of applications provide this feature through trapping the pasted text beforehand.

PureText as mentioned already is the way to go."
Guest [Entry]

"This is not determined by Windows, but by the app to which you are pasting.

For MS Word, set the default by File -> Options -> Advanced -> Cut, copy, and paste:

Alternatively, if you want to keep the default settings yet paste unformatted text occasionally, you may use Ctrl+v, Ctrl, t. (Note: this is NOT Ctrl+t.)

For Excel you may paste unformatted text with Ctrl+v, Ctrl, m."
Guest [Entry]

Using an app like ClipMate, which is a clipboard manager (& commerical app), you can press the Win + W keys together to clear the formatting of whatever is currently on the clipboard, making it plain text.