Document Event-Driven Macros

This section describes how to assign scripts to application, document or form events.

You can automatically execute a macro when a specified software event occurs by assigning the desired macro to the event. The following table provides an overview of document events and at what point an assigned macro is executed.

བྱ་ལས་

གཏན་འཁེལ་བའི་ཧུང་ལག་བསྟར་ཟིན་...

routine

Start Application

...after a LibreOffice application is started.

OnStartApp

Close Application

...LibreOffice ཉེར་སྤྱོད་བྱ་རིམ་བར་འཚམས་འཇོག་མ་རྗེས་གོང།

OnCloseApp

Document created

...New document created with File - New or with the New icon. Note that this event also fires when Basic IDE opens.

OnCreate

New Document

...ཡིག་ཆ་ - གསར་བཟོ་བརྒྱུད་འདེམས་པ་འམ་ཡང་ན་གསར་བཟོ་རིས་རྟགས་ཀྱི་ཡིག་ཚགས་གསར་པ་གསར་བཟོ་རྗེས་རྐྱང་རྡེབ་བྱེད།

OnNew

Document loading finished

...before a document is opened with File - Open or with the Open icon.

OnLoadFinished

ཡིག་ཚགས་ཁ་ཕྱེ་བ་

...ཡིག་ཆ་འདེམས་པ་རྒྱུད་ - ཁ་ཕྱེ་ཡང་ན་རྐྱང་རྡེབ་བྱེད་ཁ་ཕྱེ་རིས་རྟགས་ནི་ཡིག་ཚགས་ཁ་ཕྱེ་རྗེས།

OnLoad

Document is going to be closed

...ཡིག་ཚགས་ཁ་མ་རྒྱབ་གོང།

OnPrepareUnload

Document closed

...ཡིག་ཚགས་ཁ་མ་རྒྱབ་རྗེས་ དོ་སྣང་བྱ་རྒྱུ་ ཡིག་ཚགས་ཁ་མ་རྒྱབ་གོང་ཉར་ཚགས་སྐབས་ཡིག་ཚགས་"ཡིག་ཚགས་ཉར་ཚགས་"བྱ་བ་ཐོན་ཟིད།

OnUnload

-no UI-

OnLayoutFinished

View created

Document is displayed. Note that this event also happens when a document is duplicated.

OnViewCreated

View is going to be closed

Document layout is getting removed.

OnPrepareViewClosing

View closed

Document layout is cleared prior to the document closure.

OnViewClosed

ཡིག་ཚགས་གསོག་སློང་

...ཡིག་ཚགས་ནི་མདུན་ལྗོངས་རྗེས་ལ་མངོན།

OnFocus

ཡིག་ཚགས་སྤྱོད་མཚམས་འཇོག་

...ཡིག་ཚགས་གཞན་ཞིག་བདུན་ལྗོངས་རྗེས་ལ་མངོན།

OnUnfocus

ཡིག་ཚགས་ཉར་ཚགས་

ཚལ་ཐོའི་བཀའ་ཚིག་[ཡིག་ཆ་] - [ཉར་ཚགས་]་ཡང་ན་རྐྱང་རྡེབ་བྱེད་ཉར་ཚགས་རིས་རྟགས་ནི་ཡིག་ཚགས་ཁ་ཕྱེ་རྗེས་(ཡིག་ཚགས་མིང་གཏན་འཁེལ་བ་ཆ་གཞག་ནས་)

OnSaveAs

ཡིག་ཚགས་ཉར་ཚགས་ཟིན་

ཚལ་ཐོའི་བཀའ་ཚིག་[ཡིག་ཆ་] - [ཉར་ཚགས་]བེད་སྤྱོད་བྱེད་ཡང་ན་"ཉར་ཚགས་"རྐྱང་རྡེབ་བྱེད་རིས་རྟགས་ཡིག་ཚགས་རྗེས་ཉར་ཚགས་(ཡིག་ཚགས་མིང་གཏན་འཁེལ་བ་ཆ་གཞག་ནས་)

OnSaveDone

Saving of document failed

Document could not be saved.

OnSaveFailed

ཡིག་ཚགས་གཞན་ཉར་བྱེད་

...གཏན་འཁེལ་་མིང་ཡིག་ཚགས་སྔོན་ལ་ཉར་ཚགས་བྱེད་(ཡིག་ཚགས་གཞན་ཉར་[ཡིག་ཆ་] - [གཞན་ཉར་...]འདེམས་ གལ་སྲིད་ཡིག་ཚགས་མིང་གཏན་མ་འཁེལ་ན་[ཡིག་ཆ་] - [ཉར་ཚགས་]ཡང་ན"ཉར་ཚགས་"རིས་རྟགས་ཉར་ཚགས་)་རྐྱང་རྡེབ་བྱེད།

OnSaveAs

ཡིག་ཚགས་གཞན་ཉར་ཟིན་

གཏན་འཁེལ་མིང་ཡིག་ཚགས་རྗེས་ཉར་ཚགས་བྱེད་(ཡིག་ཚགས་གཞན་ཉར་[ཡིག་ཆ་] - [གཞན་ཉར་...]འདེམས་ གལ་སྲིད་ཡིག་ཚགས་མིང་གཏན་མ་འཁེལ་ན་[ཡིག་ཆ་] - [ཉར་ཚགས་]ཡང་ན"ཉར་ཚགས་"རིས་རྟགས་ཉར་ཚགས་)་རྐྱང་རྡེབ་བྱེད།

OnSaveAsDone

'Save As' has failed

Document could not be saved.

OnSaveAsFailed

-no UI-

When the document disk location has changed, for example after a File - Save As action.

OnStorageChanged

Storing or exporting copy of document

...before a document is saved with File - Save a Copy, File - Export, File - Export as PDF or the Save icons.

OnCopyTo

Document copy has been created

...after a document is saved with File - Save a Copy, File - Export, File - Export as PDF or the Save icons.

OnCopyToDone

Creating of document copy failed

Document could not be copied or exported.

OnCopyToFailed

Print document

...after the Print dialog is closed, but before the actual print process begins. This event occurs for each copy printed.

OnPrint

-no UI-

...after document security settings have changed.

OnModeChanged

'Modified' status was changed

Modified state of a document has changed.

OnModifyChanged

Document title changed

When the document title gets updated.

OnTitleChanged

Loaded a sub component

...after a database form has been opened.

OnSubComponentOpened

Closed a sub component

...after a database form has been closed.

OnSubComponentClosed

Printing of form letters started

...before printing form letters using File - Print or Tools - Mail Merge Wizard menus.

OnMailMerge

Printing of form letters finished

...after printing of form letters using File - Print or Tools - Mail Merge Wizard menus.

OnMailMergeFinished

Printing of form fields started

...before printing form fields.

OnFieldMerge

Printing of form fields finished

...after printing form fields.

OnFieldMergeFinished

ཤོག་གྲངས་བཟོ་བཅོས་

When the page count changes.

OnPageCountChanged


note

Most events relate to documents, except OnStartApp, OnCloseApp, OnCreate and OnLoadFinished that occur at application level. OnSubComponentOpened, and OnSubComponentClosed events are fired by database's forms.


tip

Writer documents are triggering those specific events: OnLayoutFinished, OnMailMerge, OnMailMergeFinished, OnFieldMerge, OnFieldMergeFinished and OnPageCountChanged.


བྱ་ལས་ལ་ཧུང་གཏན་འཁེལ་བྱེད་

  1. ཡོ་བྱད་ - རང་མཚན་འཇོག་འདེམས་དེ་རྗེས་་བྱས་ལས་འདེམས་གཞི་ཁ་རྐྱང་རྡེབ་བྱས་བྱེད།

  2. LibreOffice བདམས་གཞིའི་གཏན་འཁེལ་བའི་ཁྱོན་ཡོངས་ནུས་ལྡན་གྱིས་ཧུང་འདེམས་ཡང་ན་ཡིག་ཚགས་འདེམས་གཞི་གཏན་འཁེལ་ནི་མིང་སྔའི་ཡིག་ཚགས་ནུས་ལྡན་གྱིས་ཧུང་ཁོ་ན་འདེམས།

  3. བྱ་ལས་རེའུ་མིག་ནང་བྱ་ལས་འདེམས།

  4. ནས་ཧུང་རེའུ་མིང་ནང་སྨོ་ལིང་གཅིག་འདེམས་ གཞན་ཧུང་གཏན་འཁེལ་ཚུད་པ་འདེམས་པའི་བྱ་ལས་ལ་སྤྱོད་ རེའུ་འགོད་འདི་ནང་སྨོ་ལིང་ བྱ་རིམ་མཛོད་ དང་ཡིག་དང་ཡིག་ཚགས་བཟོ་ལྟའི་རིམ་པའི་ཚུལ་གིས་རེའུ་མིག་ཚུད་ཡོད།

  5. གཏན་འཁེལ་རྐྱང་རྡེབ་བྱེད།

  6. "གཏན་འཁེལ་"ཁ་རྒྱབ་གླིང་སྒྲོམ་རྐྱང་རྡེབ་བྱེད།

བྱ་ལས་ལ་ཧུང་གཏན་འཁེལ་བྱེད་སུབ་པ་

  1. ཡོ་བྱད་ - རང་མཚན་འཇོག་འདེམས་དེ་རྗེས་་བྱས་ལས་འདེམས་གཞི་ཁ་རྐྱང་རྡེབ་བྱས་བྱེད།

  2. LibreOffice གདེམས་གཞི་རྩེས་མེད་གཏང་བའི་ཁྱོན་ཡོངས་ནུས་ལྡན་གྱིས་ཞུང་འདེམས་ཡང་ན་ཡིག་ཚགས་འདེམས་གཞིའི་མིག་སྔའི་ཡིག་ཚགས་ནུས་ལྡན་གྱི་ཧུང་ཁོ་ན་རྩེས་མེད་གཏོང།

  3. བྱ་ལས་རེའུ་འགོད་ནང་གཏན་འཁེལ་བའི་ཧུང་གི་བྱ་ལས་རྩེས་མེད་གཏང་བ་ཚུད་པ་འདེམས།

  4. སུབ་པ་རྐྱང་རྡེབ་བྱེད།

  5. "གཏན་འཁེལ་"ཁ་རྒྱབ་གླིང་སྒྲོམ་རྐྱང་རྡེབ་བྱེད།

In addition to assigning macros to events, one can monitor events triggered in LibreOffice documents.

Please support us!