Avoid a dialog box with PasteUnformatted function

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Altau
Posts: 7
Joined: Tue Jun 13, 2023 4:43 pm
Location: France

Avoid a dialog box with PasteUnformatted function

Post by Altau »

Hello,

Is it possible to avoid having to reply in a dialog box when using the uno:PasteUnformatted function?

Thank you in advance for your answers.

--
Alain
LibreOffice 7.5 on Kubuntu 23.04
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: avoid a dialog box with PasteUnformatted function

Post by Villeroy »

Ctrl+Alt+Shift+V (LibreOffice)
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Altau
Posts: 7
Joined: Tue Jun 13, 2023 4:43 pm
Location: France

Re: avoid a dialog box with PasteUnformatted function

Post by Altau »

Thanks for your reply Villeroy, but it's this keyboard command that usually requires a response in a dialog box that I run in a basic macro and that requires me to validate with the keyboard, which I'd like to avoid.
LibreOffice 7.5 on Kubuntu 23.04
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: avoid a dialog box with PasteUnformatted function

Post by Villeroy »

Ctrl+Shift+V prompts for the type of content.
Ctrl+Alt+Shift+V doesn't.

See menu:Tools>Customize... tab "Keyboard"
Attachments
Bildschirmfoto von 2023-06-13 18-13-28.png
Bildschirmfoto von 2023-06-13 18-13-28.png (21.04 KiB) Viewed 2880 times
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
RoryOF
Moderator
Posts: 34619
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: avoid a dialog box with PasteUnformatted function

Post by RoryOF »

Might the Print command help - it outputs to the current output channel (the screen) and doesn't require any acknowledgement.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Altau
Posts: 7
Joined: Tue Jun 13, 2023 4:43 pm
Location: France

Re: avoid a dialog box with PasteUnformatted function

Post by Altau »

I'm sorry, but as I don't speak English very well, I use Deepl to communicate. I think I was misunderstood. In a macro, using the uno:Pasteunformatted function, I get a dialog box that I don't want; I want the program to send a "press" on the Enter key. Is this possible?
LibreOffice 7.5 on Kubuntu 23.04
User avatar
Zizi64
Volunteer
Posts: 11364
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Avoid a dialog box with PasteUnformatted function

Post by Zizi64 »

I think I was misunderstood. In a macro, using the uno:Pasteunformatted function, I get a dialog box that I don't want; I want the program to send a "press" on the Enter key. Is this possible?
Which application and document type you want to paste unformatted contents to?
You can put strings, numeric values by macro without any formatting properties and without calling the pasteSpecial feature into the spreadsheet cells.
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Altau
Posts: 7
Joined: Tue Jun 13, 2023 4:43 pm
Location: France

Re: Avoid a dialog box with PasteUnformatted function

Post by Altau »

The data comes from a .csv file containing dates in en/us format. If I use any command other than <Ctrl> <Shift> <Alt> V, the dates are understood as text.
LibreOffice 7.5 on Kubuntu 23.04
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Avoid a dialog box with PasteUnformatted function

Post by Villeroy »

Altau wrote: Tue Jun 13, 2023 6:47 pm The data comes from a .csv file containing dates in en/us format. If I use any command other than <Ctrl> <Shift> <Alt> V, the dates are understood as text.
This is because you ignore the import optioins.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Altau
Posts: 7
Joined: Tue Jun 13, 2023 4:43 pm
Location: France

Re: Avoid a dialog box with PasteUnformatted function

Post by Altau »

Thanks for your reply, I'll look into it.
LibreOffice 7.5 on Kubuntu 23.04
Altau
Posts: 7
Joined: Tue Jun 13, 2023 4:43 pm
Location: France

Re: Avoid a dialog box with PasteUnformatted function

Post by Altau »

I've tested a multitude of options with ctrl+shift+V but I never get what I get with ctrl+shift+alt+V. In the first case, the dates are pasted as strings with an apostrophe in front of them.
For example, the string 2023/06/13 00:00:03 becomes '2023/06/13 00:00:03 with ctrl+shift+V, whereas it is pasted as a date with ctrl+shift+alt+V.
If you have any ideas, I'd love to hear from you!
LibreOffice 7.5 on Kubuntu 23.04
Altau
Posts: 7
Joined: Tue Jun 13, 2023 4:43 pm
Location: France

Re: Avoid a dialog box with PasteUnformatted function

Post by Altau »

I've come up with a solution: copy and paste line by line.
The disadvantage, apart from the slowness, is that the empty cells in the source overwrite the existing cells in the destination, which wasn't the case with block copying. But if it's the only solution for not having to be present when the macro is executed, it's a good help.
LibreOffice 7.5 on Kubuntu 23.04
Post Reply