组织库和模块

Basic Libraries Containers

LibreOffice Basic libraries can be stored in 3 different containers:

To access macros stored in libraries of Application Macros or My Macros from another container, including the document container, use the GlobalScope specifier.

管理程序库

创建新库

  1. Choose Tools - Macros - Organize Macros - Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog.

  2. 点击「」选项卡。

  3. Select to where you want to attach the library in the Location list. If you select Application Macros & Dialogs, the library will belong to the LibreOffice application and will be available for all documents. If you select a document the library will be attached to this document and only available from there.

  4. 点击「新建」,插入名称以创建新的库。

导入库

  1. Choose Tools - Macros - Organize Macros - Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog.

  2. 点击「」选项卡。

  3. Select to where you want to import the library in the Location list. If you select Application Macros & Dialogs, the library will belong to the LibreOffice application and will be available for all documents. If you select a document the library will be imported to this document and only available from there.

  4. 点击「导入...」,然后选择要导入的外部库。

  5. 在「导入程序库」对话框中选择所有要导入的程序库。选中某个文件后,对话框中会显示该文件含有的所有程序库。

  6. 如果要将程序库作为引用插入,请选中「当作引用插入 (只读)」复选框。在 Basic IDE 中,只读程序库具有程序库的全部功能,但不能进行修改。

  7. 如果要改写同名的现有程序库,请选中「替换现有的程序库」复选框。

  8. 点击「确定」导入库。

导出库

  1. Choose Tools - Macros - Organize Macros - Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog.

  2. 点击「」选项卡。

  3. 在「位置」列表中您可以指定库存储的位置。选择要导出的库。注意您不能导出「标准」库。

  4. 点击「导出...

  5. Choose whether you want to export the library as an extension or as a BASIC library.

  6. 点击「确定」。

  7. 选择您希望导出库的位置。

  8. 点击「保存」导出库。

删除程序库

  1. Choose Tools - Macros - Organize Macros - Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog.

  2. 点击「」选项卡。

  3. 从列表中选择要删除的程序库。

  4. 点击「删除」。

管理模块和对话框

创建新的模块或对话框

  1. Choose Tools - Macros - Organize Macros - Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog.

  2. 点击「模块」选项卡或「对话框」选项卡。

  3. 选择要向其中插入模块的程序库,然后点击「新建」。

  4. 为模块或对话框输入名称,然后点击「确定」。

重命名模块或对话框

  1. Choose Tools - Macros - Organize Macros - Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog.

  2. 双击要重新命名的模块,双击之间稍有停顿。输入新名称。

    在 Basic IDE 中,在屏幕底部选项卡中的模块名称或对话框名称上点击右键,选择「重命名」并输入新名称。

  3. 按 Enter 键确认修改。

删除模块或对话框

  1. Choose Tools - Macros - Organize Macros - Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog.

  2. 点击「模块」选项卡或「对话框」选项卡。

  3. 从列表中选择要删除的模块或对话框。如果需要,可以通过双击某条目展开子条目。

  4. 点击「删除」。

warning

永久删除模块将删除该模块中现有的全部过程和函数。


在文档和模板中管理项目

在文档、模板和应用程序之间移动或复制模块。

  1. 打开所有需要移动或复制模块或对话框的文档或模板。

  2. Choose Tools - Macros - Organize Macros - Basic and click Organizer or click the Select Module icon in the Basic IDE to open the Macro Organizer dialog.

  3. 要将模块或对话框移至另一文档中,请点击列表中相应的对象,然后将其拖动到所需的位置。拖动时会有一条水平线指示当前对象的目标位置。拖动时按住 键可以复制对象,而不是移动对象。

请支持我们!