# Help with macro in LOWriter

In a previous version of LibreOffice I had created a macro that I called upon with a keyboard shortcut. It worked like this: I would highlight text in libreoffice writer and hit the assigned key (F4) and the selected text would be marked as norwegian language.

This was very usefull because I get a lot of small texts in other languages that I translate to norwegian.

Then I changed OS to Manjaro KDE and upgraded LO to 6.3.6.2 and happily re-created the macro from scratch. The macro worked that first time. Now, whenever I call upon the macro in a new document I get:

A Scripting Framework error occurred while running the Basic script vnd.sun.star.script:Standard.Module1.norsk?language=Basic&location=application.

Message: The following Basic script could not be found: library: 'Standard' module: 'Module1' method: 'norsk' location: 'application'

And if I open the macro (as if I wanted to edit it, not that I would know how to do that) I get another error saying:

BASIC syntax error. Sub procedure or function procedure set_nor already defined.

I am a pretty basic user of LibreOffice so I have no idea what this means, and I was hoping somebody would be able to lend me a hand.

Thank you!

1. Yes, Tools->language for selection, is the best option because the document may contain texts in other languages too.
2. Not sure if I understand what you mean, but I want the language set to Norwegian so that I can use spellcheck and make sure I don't leave any typo in the text.
3. I went Tools-> Organize macros -> LibreOffice Basic Macros and there I looked up my macro under My Macros > Standard > Module1. Then I selected it and hit Edit.

But.. It seems I found the solution. I created the macro again and this time when trying to assign it to a keyboard shortcut I got an error saying I needed to install JRE. I did that and it seems to work now. I have tried opening several different documents and so far it looks good.

edit retag close merge delete

Just a few questions in return:
-1- Do you actually want to set the language like via >Tools>Language>For Selection?
-2- In what way do you want to make use of the setting?
-3- Where ( in what way exactly) did you open the macro for editing? At what step came the error message?

( 2020-07-11 17:28:00 +0200 )edit

Quoting @eexxil;
3. I went Tools-> Organize macros -> LibreOffice Basic Macros and there I looked up my macro under My Macros > Standard > Module1. Then I selected it and hit Edit.
I still can't understand how you might get the second error message this way. - and the first message tells the assigned macro should have the simple name "norsk", not something like "set_nor".
(I will have a break now.)

( 2020-07-11 18:20:18 +0200 )edit

Sort by » oldest newest most voted

There may be a problem with your user profile.
I can, however, not tell you anything specific concerning your OS. If the example and the described proceeding don't work for you, another user of KDE may help. My own experiences with KDE are too old (>6 a) and mostly forgotten.

Please open it, move the (prettier) macro to the mentioned local library of your system, customize F4 (or the key you now prefer) newly to it, and try it out.
Example:

more

It seems I found the solution. I created the macro again and this time when trying to assign it to a keyboard shortcut I got an error saying I needed to install JRE. I did that and it seems to work now. I have tried opening several different documents and so far it looks good.

Should I close this question now?

more