Ask Your Question

Revision history [back]

This question is a bright example of how to not ask questions from fellow users that compose this community-driven project. Anyone would easily see frustration, anger etc, but will have hard time understanding what exactly the asker actually wants. And if that is some psychological help that is required, then this is a wrong forum to get it.

If, however, a solution of use issue is wanted, then the best is to strip emotions from your words, and give clear information to readers: what you are trying to do (I assume, this will be "I'm trying to paste plain text from clipboard"), what problem do you see (maybe it's "I can't find a way to do it without additional step - either two clicks with mouse to choose from drop-down menu, or selecting from Paste Special dialog"), and what you've tried so far ("I tried to customize keyboard shortcuts, but didn't find "Paste as Plain Text" action; I tried to write a macro, but this is what doesn't work for me: it gives .... <here is="" my="" macro="">") etc.

Trying to answer your question, I recorded a macro, and it seems to just do the job:

sub PasteText
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 ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Format"
args1(0).Value = 1

dispatcher.executeDispatch(document, ".uno:PasteSpecial", "", 0, args1())


end sub

I don't know it you tried this, and if it somehow doesn't suite your needs. But I would save this macro to "My Macros"->"Standard", and assign a keyboard shortcut to it to give a try.