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

응용 프로그램 시작

...after a LibreOffice application is started.

OnStartApp

응용 프로그램 닫기

...LibreOffice 응용 프로그램이 종료되기 전

OnCloseApp

문서 생성됨

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

OnCreate

새 문서

...파일 - 새로 만들기 또는 새로 만들기 아이콘을 사용하여 새 문서를 만든 후

OnNew

문서 로드 마침

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

OnLoadFinished

문서 열기

...파일 - 열기 또는 열기 아이콘을 사용하여 문서를 연 후

OnLoad

문서가 닫히려고 함

...문서를 닫기 전

OnPrepareUnload

닫힌 문서

...문서를 닫은 후. 문서를 닫기 전에 저장하면 "문서 저장" 이벤트도 발생할 수 있다는 것에 주의합니다.

OnUnload

-no UI-

OnLayoutFinished

보기 생성됨

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

OnViewCreated

보기가 닫히려고 함

Document layout is getting removed.

OnPrepareViewClosing

보기 닫힘

Document layout is cleared prior to the document closure.

OnViewClosed

문서 활성화

...문서를 맨 앞으로 가져온 후

OnFocus

문서 비활성화

...다른 문서를 맨 앞으로 가져온 후

OnUnfocus

문서 저장

...파일 - 저장 또는 저장 아이콘을 사용하여 문서를 저장하기 전(문서 이름을 이미 지정한 경우)

OnSaveAs

문서가 저장되었습니다.

...파일 - 저장 또는 저장 아이콘을 사용하여 문서를 저장한 후(문서 이름을 이미 지정한 경우)

OnSaveDone

문서 저장 실패

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

문서 사본을 저장하거나 내보내기

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

OnCopyTo

문서 사본이 생성됨

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

OnCopyToDone

문서 사본의 생성에 실패

Document could not be copied or exported.

OnCopyToFailed

문서 인쇄

...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 state of a document has changed.

OnModifyChanged

문서 제목 변경됨

When the document title gets updated.

OnTitleChanged

하위 콤포넌트 로드됨

...after a database form has been opened.

OnSubComponentOpened

하위 콤포넌트를 닫힘

...after a database form has been closed.

OnSubComponentClosed

양식 편지 인쇄 시작

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

OnMailMerge

양식 편지 인쇄 마침

...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. 저장 위치 목록 상자에서 할당을 전역적으로 유효하게 할지 또는 현재 문서에서만 유효하게 할지 선택합니다.

  3. 이벤트 목록에서 이벤트를 선택합니다.

  4. 매크로를 클릭하고 선택한 이벤트에 할당할 매크로를 선택합니다.

  5. 확인을 클릭하여 매크로를 할당합니다.

  6. 확인을 클릭하여 대화 상자를 닫습니다.

이벤트에 대한 매크로 할당 제거

  1. 도구 - 사용자 정의를 선택하고 이벤트 탭을 선택합니다.

  2. 저장 위치 목록 상자의 옵션을 선택하여 전역 할당 또는 현재 문서에서만 유효한 할당을 제거할지 선택합니다.

  3. 제거할 할당이 포함된 이벤트를 이벤트 목록에서 선택합니다.

  4. 제거를 클릭합니다.

  5. 확인을 클릭하여 대화 상자를 닫습니다.

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