[Solved] First macro Python

Creating a macro - Writing a Script - Using the API

[Solved] First macro Python

Postby Math » Tue Mar 12, 2019 8:53 am

Greetings ,

I'm starting studies on Python programming, so I'm trying to run my first Python macro in LibreOffice, but so far I have not succeeded .

I researched the forum and found an example of sr. FJCC that explains a simple Python macro, but I could not make it work .

is it missing something ? I noticed in the macro of sr. FJCC that it does not have at the beginning of the macro the initial Sub and at the end of the macro does not have end sub, therefore it is in the macro VB (Basic) .

hug friends .
Last edited by Math on Fri Mar 15, 2019 9:08 pm, edited 1 time in total.
LibreOffice on Windows 7
Posts: 89
Joined: Mon Oct 29, 2018 6:32 pm

Re: first macro Python

Postby LibreOfficiant » Tue Mar 12, 2019 10:21 am

Some detailed description of the exact course of actions you followed would help assist you..

Refer to LibreOffice Python Scripts Help (work in progress) for Python macros, its content is applicable to (Open/Libre)Office and isn't limited to 6.3.

Apache OpenOffice Python wiki provides plenty of information that's applicable to LibreOffice too.

Install Alternative Python Script Organiser extension to manage embedded .py scripts, run the interactive shell or debug Python macros.

Happy Python!

note: IDE_utils provides (Libre/Open)Office Python macro simple enablement for IDEs.
libO 5.4 64bit, (PortableApps: libO 6.0, aOO 4.1, OOo 3.2 32bit) on Win7/Win10 x64 | aOO 4.1.x & libO 5.4.x on Mint 18 Sarah & OSX 10.9 Mavericks x64
Python toolbox: Geany, PyCharm and APSO, MRI extensions..
User avatar
Posts: 8
Joined: Wed Jan 25, 2017 9:36 pm

Re: first macro Python

Postby John_Ha » Tue Mar 12, 2019 1:03 pm

See Spell checker "red wriggly lines" - beta test fix for AOO for a working Python macro for AOO.
LO, 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.
Posts: 7707
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

[Solved] First macro Python

Postby Math » Tue Mar 12, 2019 5:16 pm

greetings sr. LibreOfficiant and sr. John_Ha ,

thank you very much for your nominations for studies, I will analyze the Links indicated by the gentlemen, and having other doubts I will put here in the post . :super:

so for now I'm going to study the Links .

hugs friends .
LibreOffice on Windows 7
Posts: 89
Joined: Mon Oct 29, 2018 6:32 pm

Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 3 guests