You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2022/03/11 11:34:44 UTC

[Issue 113171] OO does not paste the text contents of the Windows clipboard - instead, it pastes the previous text copied in OO

https://bz.apache.org/ooo/show_bug.cgi?id=113171

--- Comment #39 from John <jo...@yahoo.co.uk> ---
See Paste from external program to Writer not working at
https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=107293#p522162
where it is reported that using a macro to open and close the clipboard before
doing a paste prevents this behaviour.  

While not a perfect solution I would have thought it should be fairly simple
and non-disruptive to add the Open and close clipboard code to the Copy/Paste
code.

    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

-- 
You are receiving this mail because:
You are on the CC list for the issue.
You are the assignee for the issue.