[Solved] First macro Python

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
Math
Posts: 89
Joined: Mon Oct 29, 2018 6:32 pm

[Solved] First macro Python

Post by Math »

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 5.4.4.2 on Windows 7
User avatar
LibreOfficiant
Posts: 12
Joined: Wed Jan 25, 2017 9:36 pm

Re: first macro Python

Post by LibreOfficiant »

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..
https://wiki.documentfoundation.org/Macros/Design_Guide
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: first macro Python

Post by John_Ha »

See Spell checker "red wriggly lines" - beta test fix for AOO for a working Python macro for AOO.
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.
Math
Posts: 89
Joined: Mon Oct 29, 2018 6:32 pm

[Solved] First macro Python

Post by Math »

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 5.4.4.2 on Windows 7
Post Reply