Page 1 of 1
Avoid a dialog box with PasteUnformatted function
Posted: Tue Jun 13, 2023 4:48 pm
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
Re: avoid a dialog box with PasteUnformatted function
Posted: Tue Jun 13, 2023 5:48 pm
by Villeroy
Ctrl+Alt+Shift+V (LibreOffice)
Re: avoid a dialog box with PasteUnformatted function
Posted: Tue Jun 13, 2023 5:58 pm
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.
Re: avoid a dialog box with PasteUnformatted function
Posted: Tue Jun 13, 2023 6:14 pm
by Villeroy
Ctrl+Shift+V prompts for the type of content.
Ctrl+Alt+Shift+V doesn't.
See menu:Tools>Customize... tab "Keyboard"
Re: avoid a dialog box with PasteUnformatted function
Posted: Tue Jun 13, 2023 6:15 pm
by RoryOF
Might the Print command help - it outputs to the current output channel (the screen) and doesn't require any acknowledgement.
Re: avoid a dialog box with PasteUnformatted function
Posted: Tue Jun 13, 2023 6:32 pm
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?
Re: Avoid a dialog box with PasteUnformatted function
Posted: Tue Jun 13, 2023 6:38 pm
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.
Re: Avoid a dialog box with PasteUnformatted function
Posted: Tue Jun 13, 2023 6:47 pm
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.
Re: Avoid a dialog box with PasteUnformatted function
Posted: Tue Jun 13, 2023 7:53 pm
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.
Re: Avoid a dialog box with PasteUnformatted function
Posted: Tue Jun 13, 2023 7:55 pm
by Altau
Thanks for your reply, I'll look into it.
Re: Avoid a dialog box with PasteUnformatted function
Posted: Tue Jun 13, 2023 8:19 pm
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!
Re: Avoid a dialog box with PasteUnformatted function
Posted: Tue Jun 13, 2023 11:30 pm
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.