Launching macros in Writer
-
- Posts: 20
- Joined: Mon Jun 30, 2014 12:28 pm
Launching macros in Writer
Hello everyone,
in Word 2003 I had files I often accessed in a customizable Work menu (you just opened the file clicked on the menu clicked on Add and from then on it was on the menu). Alternatively I pressed Alt-F8 typed a three letter macro name and could launch a macro which opened the file (or did other things of course).
In Libre Writer I can't find any menu similar to the Work one
Also, I tried recording a macro that opens a file but when the file is opened it stops recording and the macro is not saved.
Even if I were to record a macro, opening a macro seems to require going through several submenus, which is time consuming to the point I might as well open the file directly. Isn't there a quicker way to do things? Do I need to associate the macro to a keyboard communication?
in Word 2003 I had files I often accessed in a customizable Work menu (you just opened the file clicked on the menu clicked on Add and from then on it was on the menu). Alternatively I pressed Alt-F8 typed a three letter macro name and could launch a macro which opened the file (or did other things of course).
In Libre Writer I can't find any menu similar to the Work one
Also, I tried recording a macro that opens a file but when the file is opened it stops recording and the macro is not saved.
Even if I were to record a macro, opening a macro seems to require going through several submenus, which is time consuming to the point I might as well open the file directly. Isn't there a quicker way to do things? Do I need to associate the macro to a keyboard communication?
LibreOffice Version: 6.0.7.3 (x64)
Build ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5
CPU threads: 4; OS: Windows 10.0; UI render: default;
Locale: it-IT (it_IT); Calc: group
Build ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5
CPU threads: 4; OS: Windows 10.0; UI render: default;
Locale: it-IT (it_IT); Calc: group
-
- Posts: 20
- Joined: Mon Jun 30, 2014 12:28 pm
Re: launching macros in Writer
In addition to what I wrote, I've just read online that Libre macros are unable of opening a window (which is depressing considering Word Perfect 5.1, the Dos-based Word-Processor I was using 30 years ago could handle this fine).
So, if that is indeed the case, I would rephrase the above question: in the absence of a macro, any quick way of accessing a file?
So, if that is indeed the case, I would rephrase the above question: in the absence of a macro, any quick way of accessing a file?
LibreOffice Version: 6.0.7.3 (x64)
Build ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5
CPU threads: 4; OS: Windows 10.0; UI render: default;
Locale: it-IT (it_IT); Calc: group
Build ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5
CPU threads: 4; OS: Windows 10.0; UI render: default;
Locale: it-IT (it_IT); Calc: group
Re: launching macros in Writer
If it isn't on the recently used list, then I don't know of a quicker method than File | Open in AOO. You could create shortcuts via your operating system; obviously that may become inconvenient with a large number of files.
There is an extension history manager which allows you to increase the number of recent file names stored; my experience with it has been less than desirable.
There is an extension history manager which allows you to increase the number of recent file names stored; my experience with it has been less than desirable.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
-
- Posts: 20
- Joined: Mon Jun 30, 2014 12:28 pm
Re: Launching macros in Writer
Thx, David. That's disappointing news
LibreOffice Version: 6.0.7.3 (x64)
Build ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5
CPU threads: 4; OS: Windows 10.0; UI render: default;
Locale: it-IT (it_IT); Calc: group
Build ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5
CPU threads: 4; OS: Windows 10.0; UI render: default;
Locale: it-IT (it_IT); Calc: group
Re: Launching macros in Writer
There are some useful macros at http://open-office.es including, if I remember correctly, a macro toolbar that permits speedy access to the installed macros. That site is in Spanish, so you may need to pass sentences through a translator.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Launching macros in Writer
If you can locate a copy of How_to_use_basic_macros.sxw (sxw is an outdated OO format, and can be converted to .odt by earlier OO versions, perhaps Oo 3.x(?)), this is a brief introduction to using macros in OO and includes instructions for linking a macro to a toolbar button.
It does not teach OO BASIC - it assumes you have a working knowledge of that; from memory its screenshots of the builtin macro organiser are from a very early version of OO, but they can be related easily to the current screens.
The master work on OO macros is still that of Andrew Pitonyak.
It does not teach OO BASIC - it assumes you have a working knowledge of that; from memory its screenshots of the builtin macro organiser are from a very early version of OO, but they can be related easily to the current screens.
The master work on OO macros is still that of Andrew Pitonyak.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Launching macros in Writer
This macro will open a file. Just change "C:\tmp\footnote test.odt" to the path of your file. It will work in LibreOffice
Edit: corrected to 'as new com.sun.star.beans.PropertyValue'
Code: Select all
Sub OpenFile()
dim oDoc,opth as string, args() as new com.sun.star.beans.PropertyValue
opth= "C:\tmp\footnote test.odt"
oDoc = StarDesktop.loadComponentFromURL(convertToURL(opth), "_blank", 0, Args())
End Sub
Last edited by JeJe on Fri Feb 22, 2019 5:27 pm, edited 1 time in total.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Launching macros in Writer
If you go to Tools/macros/organise macros/LibreOffice Basic/ My Macros/standard module and put the macro there... then
using Tools/customize, you can assign a shortcut or a toolbar item or a menubar item to the macro.
using Tools/customize, you can assign a shortcut or a toolbar item or a menubar item to the macro.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
Re: Launching macros in Writer
See [Tutorial] How to record a macro (and Regular Expressions) for many references.
LO 6.4.4.2, Windows 10 Home 64 bit
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.
Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
-
- Posts: 20
- Joined: Mon Jun 30, 2014 12:28 pm
Re: Launching macros in Writer
JeJe wrote:This macro will open a file. Just change "C:\tmp\footnote test.odt" to the path of your file. It will work in LibreOffice
Thanks a lot everyone, will try and let you knowCode: Select all
Sub OpenFile() dim oDoc,opth as string, args() as new com.sun.star.beans.PropertyValue opth= "C:\tmp\footnote test.odt" oDoc = StarDesktop.loadComponentFromURL(convertToURL(opth), "_blank", 0, Args()) End Sub
Edit: corrected to 'as new com.sun.star.beans.PropertyValue'
LibreOffice Version: 6.0.7.3 (x64)
Build ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5
CPU threads: 4; OS: Windows 10.0; UI render: default;
Locale: it-IT (it_IT); Calc: group
Build ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5
CPU threads: 4; OS: Windows 10.0; UI render: default;
Locale: it-IT (it_IT); Calc: group