How to use ONLYOFFICE macros to add consistent table styles to documents

Although we have introduced many macros for managing spreadsheets, there are still cases where you need to use tables in a text document editor. Using the following macro, users can set specific formatting rules for all tables in a document, such as font style, cell borders, background color, and alignment. Let’s create this simple macro together.

First, we get the active worksheet in the oDocument variable. Then, we retrieve all the tables in the document using the GetAllTables() method.

This is the core of the ForEach loop

Where the formatting rules for the table are defined. These rules will be applied consistently to all tables in the document.

We have provided some methods to give you a clearer idea of ​​what macros do. For an in-depth look at all formatting options and methods, check out the ONLYOFFICE API documentation for the table object . Here is an example showing how a table would appear after applying a macro, using an existing style defined in a ForEach loop. Note: The methods in the ForEach loop are for reference only and can be changed to suit your use case.

It is just such a simple macro

That helps you apply a style singapore whatsapp number data to all tables. ONLYOFFICE API is a powerful tool capable of performing a wide variety of tasks and provides a huge potential for developing more advanced macros and add-ins. Through this API, users can leverage the full power of ONLYOFFICE to increase productivity and simplify workflow.

If you have any questions or innovative concepts, please feel free to contact us . Looking forward to your comments and discuss or cooperate.

Complete macro code

Here is the complete code of the macro:

“Using ONLYOFFICE saves adb directory us a lot of time compared to building such a tool ourselves, allowing us to focus on our core product. Besides that, ONLYOFFICE can be easily embedded in our company’s ecosystem and meets the requirements of both of our value propositions.”
Deployment and Customization

Deploying ONLYOFFICE using

Docker image was quite resource phone number simple thanks to the comprehensive documentation. The Agriplace team found the ONLYOFFICE platform very helpful with its many customization options. When the team encountered questions, ONLYOFFICE assistance efficiently guided them through the setup process.

Scroll to Top