跳到主要内容

Macro samples

The following examples will show you how to use ONLYOFFICE macros and compare the JavaScript code with Microsoft Visual Basic for Applications code so that you could see the difference and understand what can be done to convert the VBA code to ONLYOFFICE macros.

Running the example macro

To set up and run the example macro:

  1. Open ONLYOFFICE Desktop Editors.
  2. Navigate to the View tab on the top toolbar.
  3. Click the Macros button to open the macro editor.
  4. Copy the example macro code.
  5. Paste it into the macro editor's workspace.
  6. Click Play icon to execute the macro.

Macro buttonMacro button

Run macroRun macro

Text document editor

Spreadsheet editor

Presentation editor

PDF editor

Support

If you want to request a feature or report a bug regarding macros, use the issues section on GitHub.

You can also request a macro sample by contacting us at marketing@onlyoffice.com.