How to prevent text copied from OneNote to be pasted as an image

2

1

When copying text from OneNote, it is also made available in the clipboard as an image. (Content is saved in the windows clipboard in various different format types) Some applications use the image version when pasting, causing the pasted text to come out as an image.

There are some open support tickets on the Microsoft support pages, but no feature/bug-fix seems to be in the making.

Self-answered question... but better solutions are welcome.

Wouter

Posted 2018-12-20T14:02:58.423

Reputation: 1 259

Answers

1

I've worked my way around this by writing the following AutoHotkey script

$^c::
Send ^c ; Do a normal copy to clipboard
sleep 100 ; Wait for the copy to finish
WinGet current_application, ProcessName, A ; Get the name of the current application

; if the application is OneNote, and the copied content is text ...
if ((current_application = "ONENOTE.EXE") && DllCall("IsClipboardFormatAvailable", "uint", 1)) {
    clipboard = %clipboard% ; remove the formatting
}
Return

This script detects the current application, and type of content being copied. If text is being copied from OneNote, it stores the text in the clipboard as plain text, removing the other types, causing a paste in other applications to work as expected.

The advantage of this script over the other solutions out there (that remove the formatting when using Ctrl-V) is that copy-pasting of files/images/formatted text in word, doesn't break down.

Wouter

Posted 2018-12-20T14:02:58.423

Reputation: 1 259