On 10/04/2015 01:25 AM, mowestusa wrote:
I'm running LibreOffice 5.0 on Windows 10.
I really enjoy LibreOffice, and I would like to write some simple macros to get even more value out
of LibreOffice. Writing macros will be my first programming experience, but would provide the most
benefit for my profession since I mostly produce documents, spreadsheets, and presentations in my
vocation since I do a lot of teaching. I found some materials to assist with learning and getting
started with LibreOffice Basic:
- https://wiki.documentfoundation.org/Macros
- https://help.libreoffice.org/Common/Scripting
However, while looking through the LibreOffice 5.0 Help documentation, I found this under
LibreOffice Basic / Basic / programming page:
Programming LibreOfficeLibreOfficecan be controlled by using the LibreOffice API.
| | LibreOffice provides an Application Programming Interface (API) that enables you to
control LibreOffice components by using various programming languages. A LibreOffice Software
Development Kit is available for the programming interface. |
| | For more information about LibreOffice API reference, please visit
http://api.libreoffice.org/ |
| | Macros created with LibreOffice Basic based on the old programming interface will no
longer be supported by the current version. |
Formore information on LibreOffice Basic, select "LibreOffice Basic" inthe list box.
So before I start investing a lot of time in learning LibreOffice Basic, would I be better served
learning to script macros in a different language that would then access the LibreOffice API?If so,
which language works best using LibreOffice 5.0 on Windows 10 to write macros?
Possible Macros that I would like to create:- A macro that automates the formatting of a paragraph, changing
the style, superscripting numbers, etc...- A macro that provides a quick way to look for Creative Commons
graphics by opening a browser search page. (It would be similar to the "Research" panel in Google
Docs)- A macro that provides a quick way to look up a meaning of a highlighted word in an online dictionary.
I do not have time to review all of this, but...
Ultimately, all supported languages use the same internal API, it is
mostly a question of which language you prefer to use. External
languages are generally more difficult to use initially because there
are usually external things that you must link to. The do provide more
flexibility than the built-in Basic because of their external libraries,
better IDEs, and similar. On the other hand, Basic provides many things
for free. For example, when you have an object (say a document, or a
graph), that object typically will support services and interfaces. I
won't trouble you with the details on this, but,
Suppose that an object supports an "index container" interface that lets
me access the contained things based on a numerical interface. Before I
can use that interface in Java or C++ (which I don't generally use to
control LO), I must access that interface. There are two difficulties
with this. First, I need to know which interface I need to get and
second, I need to go to the trouble of getting it. This might not be
overly difficult, but, with BASIC, that is generally hidden from you so
you can directly use all of the interfaces on the object. It just makes
it a bit easier. Sorry, I did not take the time to make this more clear,
but, I have a class I need to go teach now.
--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info: http://www.pitonyak.org/oo.php
--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.