Page 1 of 1

[Solved] Paste uses Openoffice clipboard, not Windows clipboard

Posted: Fri Mar 04, 2022 5:50 pm
by BasePlayer
I can copy and paste without any problems within a document (from one part to another), but if I copy text from another program to the clipboard (e.g. from Translate), and then paste, Writer pastes only what was already on the clipboard within the document.

This has only just started happening with Writer. Initially I thought it might be an OS problem, but if I use Notepad, for example, everything functions normally.

Having seen a similar problem on the forum, I've tried doing a Profile reset, but this makes no difference.

Any suggestions appreciated.
 Edit: Changed subject, was Paste from clipboard not working 
-- MrProgrammer, forum moderator 

Re: Paste from clipboard not working

Posted: Fri Mar 04, 2022 5:59 pm
by MrProgrammer
BasePlayer wrote:Having seen a similar problem on the forum …
Why do you not help by providing a link to the topic you have seen? If you don't know how to create link in a post, you could at least give us the date and the title.
BasePlayer wrote:if I copy text from another program to the clipboard (e.g. from Translate), and then paste, Writer pastes only what was already on the clipboard within the document.
Issue: OO does not paste the text contents of the Windows clipboard - instead, it pastes the previous text copied in OO
Topic from 2010: OOo doesn't paste last clipboard but previous

Issue 113171 from 2010 is still open. You can read the discussion. The issue title mentions Windows, but I know it happens on MacOS too, even when no "clipboard manager" is installed. Perhaps LibreOffice has corrected the problem. I do not use LibreOffice. You could search their issues list.
BasePlayer wrote:This has only just started happening with Writer. Initially Initially I thought it might be an OS problem …
Clipboard managers are known to cause trouble for OpenOffice. If you installed one recently, try removing it.
https://duckduckgo.com/?q="clipboard+ma ... osx&ia=web
BasePlayer wrote:Open Office Ver 4.1.1 on Windows 8.1 and Mac OSX 10.9
All of that is rather old. OpenOffice 4.1.1 is 2014. The current version is 4.1.11 so you are missing ten updates and might experience problems which have been fixed. Windows 8.1 is 2013 and mainstream support ended three years ago. MacOS 10.9 is 2013 and not been supported for five years. Is your signature still current? If it is wrong you risk receiving inappropriate advice. Fix your forum signature in User Control Panel → Profile → Edit Signature. There are both risks and benefits to updating software. The choice is yours, of course. Using unsupported operating systems can expose you to computer viruses.
 Edit: You can review the LibreOffice discussion about the same difficulty:
EDITING: copy-paste from non-LibO-text-source pastes previous clipboard contents
I would think if the problem were really solved the status would be VERIFIED FIXED. But it's RESOLVED WORKSFORME! Just because it works for one person doesn't mean it works for everyone. Who knows? I'm not a developer. Seems promising though. 

Re: Paste from clipboard not working

Posted: Fri Mar 04, 2022 6:37 pm
by BasePlayer
Why do you not help by providing a link to the topic you have seen? If you don't know how to create link in a post, you could at least give us the date and the title.
Sorry - I didn't think of doing that. The poster had many issues, and was very rude. The only suggestion regarding the copy/paste problem was the one I tried.
OO does not paste the text contents of the Windows clipboard - instead, it pastes the previous text copied in OO
Yes, that's what's happening now. But I have been pasting contents from the Windows clipboard (from Google Translate) for years, up until now.

But thank you for sending links to other posts. I'll see if there are any solutions in there that work for me.

BTW - I haven't installed any clipboard manager.

Re: Paste from clipboard not working

Posted: Fri Mar 04, 2022 8:58 pm
by John_Ha
Well known AOO "bug" which seems to affect very few users. I had it on my desktop but not on my laptop which was virtually identical so I think there it was probably some sort of hardware induced race hazard. It was very frequent many years ago when I posted in the forum and raised a bug report for it. Over the years it gradually went away and I haven't experienced it for many years.

If updating to the latest version doesn't fix it try to LibreOffice.

The copy/paste code in AOO is apparently very flaky.

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 12:24 pm
by JeJe
Windows 8.1 Extended Support doesn't end till January 10, 2023

I don't know how you live without a clipboard manager - I use Ditto (free).

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 12:45 pm
by BasePlayer
I found and installed version 4.1.11, and thought "that'll fix it!"
Unfortunately not!
Next step LibreOffice, I guess.

To me it just seems totally weird that this should start happening when I've been running OpenOffice for years with no problems, and
I rarely make any changes to my computer setup.

Thanks for your input.

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 12:58 pm
by BasePlayer
Just tried resetting my profile again (as the new release is clearly using my profile from the previous release).
However, when I went through the same procedure as before (using %appdata%), on reopening the program, I was taken to the installation screen.

It feels like OpenOffice has its own clipboard, and no longer knows where to find the Windows clipboard so that it can overwrite it.

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 1:07 pm
by BasePlayer
Sorry guys, I hadn't noticed that my signature was way out of date. I'm using Windows 10.

II wonder what your clipboard manager gives you that Windows doesn't. I've just had a look at the extended version, and while it lists all my recent "copies", Writer stolidly refuses to paste any of them! It will only paste the text copied in Writer itself.

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 1:11 pm
by Zizi64
I'm using Windows 10.
Win 10 has its own clipboard manager, and (maybe) the AOO is not compatible with it.
Windows 10 Clipboard History:
https://support.microsoft.com/en-us/win ... 46ddf338c6
Try the LibreOffice. It has a higher compatibility level with the newer features of the operating systems.

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 1:30 pm
by BasePlayer
Thanks, I'm going to try LibreOffice

Feels like goodbye to an old friend!

In the meantime using a workaround - external copy from wherever and paste to Notepad, save file as "paste.txt" and then insert file into Writer.

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 1:33 pm
by JeJe
Have you tried Paste Special instead of Paste?

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 1:34 pm
by BasePlayer
Yes - it made no difference.

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 1:41 pm
by BasePlayer
Just tried it again! I notice that the dialogue box says "Source: OpenOffice 4.1.11 Text Document" whereas I might have expected it to say "Clipboard"
There's no obvious way to change this. Could this be the problem?

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 1:49 pm
by JeJe
If I paste from Google translate I get a choice of Html format and unformatted text from Paste Special into Writer.

the attached document has a textbox - does it work pasting into that?

There's also a button which runs the below macro which pastes but opens and closes the clipboard first... just a wild longshot... to see if that makes any difference. (Edit: macro will only work on Windows)

Code: Select all


    Private Declare Function CloseClipboard Lib "user32" () As Long
    Private Declare Function OpenClipboard Lib "user32" (ByVal hwnd As Long) As Long

sub Openandcloseclipboardthenpaste
dim a as variant
        OpenClipboard a
        CloseClipboard
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
end sub

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 2:03 pm
by BasePlayer
Pressing the button did nothing.

Paste (Ctrl-v) just pasted the outgoing text to 'Translate' from Writer rather than the incoming translation.

Many thanks for your efforts, JeJe

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 2:06 pm
by JeJe
Are you sure you're copying text the translation from Google translate properly?

(Edit: sorry, probably a stupid question)

The button should paste so long as the cursor is in that document's text - i don't understand why that wouldn't work.

At least you have the Notepad (which I use myself a lot) workaround.

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 2:11 pm
by JeJe
You could try dragging and dropping into Writer - works for me.

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 2:17 pm
by BasePlayer
Yes, that works. Thanks.

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 2:22 pm
by JeJe
You perhaps don't have macros enabled for that document - I'm not really expecting it to make any difference.

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 3:52 pm
by BasePlayer
You were right of course. I tried it again with macro security on low.

But it still made no difference!

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 4:52 pm
by Zizi64
I tried it again with macro security on low.
You must reopen the document, after you adjust the settings.

Re: Paste from external program to Writer not working

Posted: Sat Mar 05, 2022 5:53 pm
by BasePlayer
That was it! Success!

So, you must be on to something there. Should I embed your macro in each of my documents?

Re: [Solved] Paste from external program to Writer not worki

Posted: Sat Mar 05, 2022 9:52 pm
by JeJe
That's a surprise. You can copy the macro from the post above and paste it at the top of a module in your MyMacros Standard Library. Instructions here:

viewtopic.php?t=5519

Then set a shortcut or toolbar item to call it.

Re: [Solved] Paste from external program to Writer not worki

Posted: Sat Mar 05, 2022 11:19 pm
by BasePlayer
Brilliant! Many thanks.

Re: [Solved] Paste from external program to Writer not worki

Posted: Fri Mar 11, 2022 1:36 pm
by John_Ha
See Comment 39 in Issue 113171 - OO does not paste the text contents of the Windows clipboard - instead, it pastes the previous text copied in OO where I have pointed to JeJe's macro code as a possible simple "brute force" fix for this problem.