Collabora Office 23.05 帮助
Collabora Office macros are grouped in module files, modules are usually grouped in library folders, and libraries are grouped in library containers although containers can contain modules too.
A library is used as a major grouping for either an entire category of macros, or for an entire application. Modules usually split functionality, such as user interaction and calculations. Individual macros are subroutines and functions. The Figure below shows an example of the hierarchical structure of macro libraries in Collabora Office.
Figure: Macro Library hierarchy
The containers are accessible in all Collabora Office programs through the user interface. Go to
, to open the Python Macros dialog.Three library containers are shown in the Macro From list:
My Macros: personal macros available for the Collabora Office user
Application Macros: system macros distributed with Collabora Office for every computer user
Document macros: every document can contain macro libraries available in that document for all users
要以编程方式访问 Python 脚本位置,请参阅《获取会话信息》。
该位置 (容器) 中已有的宏由安装程序复制,对所有计算机用户可用,任何打开的文档都可以放问容器中储存的宏。您需要管理员权限方可储存或编辑此处的宏。
Collabora Office 宏容器在文件系统中的位置取决于操作系统:
对于「Windows」: {Installation}\share\Scripts\python。
对于「Linux」 与「macOS」: {Installation}/share/Scripts/python。
该容器只可被 Collabora Office 用户访问。任何打开的文档都可以访问容器中存储的宏。此处的宏存储在 Collabora Office 用户配置文件中。
「我的宏」容器位于用户空间,具体路径取决于操作系统:
对于「Windows」,
%APPDATA%\LibreOffice\4\user\Scripts\python。
对于「Linux」与「macOS」,
$HOME/.config/libreoffice/4/user/Scripts/python。
文档宏嵌入在文档中,仅在文档处于打开状态时可访问。
Python macros can be organized in libraries, modules and macros. Use the Macro Library hierarchy as a guide when creating or installing new macros in module files, new module files in library folders or new library folders in containers.