Can Draw create text from Calc file

Hi, my goal here is to acquire text from cell in calc and insert as text in draw. (Please see the note below after steps before commenting)


  1. Create a Calc file.
  2. In A column each row has (random) text (say upto 10 rows)
  3. Save the file.
  4. Next in Draw, it should copy and paste text from Calc file but for each row cell it creates a new page
  5. After acquiring text data, paste and format text (according to set rules) [for example]
    i. Create a text box
    ii. Insert copied text
    iii. Increase font size to 16
    iv. Center Align text
    v. Then text box is align to center and bottom

Note: I am NOT directly asking you to write complete code for me, I will do it, but please guide me to how to do ‘x’ (as I’m not a programmer).

Also recently I used Libreoffice in my video editing process
Here are the references

Use a Shape Style for this task. Create the Style (containing the desired properties) manually in a custom template file, use (open) the template file for pasting the text, and format the shapes by applying the Style (by the macro code).

1 Like

Is this additional explanation concerning “chapter 4.” or is it an additional task?
If “additional”: Where shall now the “copied text” to be inserted come from?


  • How shall the pages in Draw be named?
  • To what layer(s) shall the TextBox objects get assigned?

I’m afraid this may come out to be a pipe dream. User’s won’t get specialised tutorials making them capable of solving tasks of such complexity. A contributor may be interested and find the time to write UserCode for a (raw) solution. The tutorial would require to spend hours, and would nonetheless be too incomplete for you and useless for all but one user (you again).
Study the LibreOffice API (and one of the bridging languages, say Basic e.g.) or hire somebody for the task.
Concerning studies: You may start with the famous texts by Andrew Pitonyak.

1 Like

I meant, When Draw is active, macro should read the local saved Calc file.

No need for special names for pages, just plain(default) serial numbers (eg., page 1, page 2,…)
Because each page needs one text from column 1 only and row n, where n = page number
Example: (Draw) Page 1 will have text from (Calc) col 1 and row 1
(Draw) Page 2 will have text from (Calc) col 1 and row 2

I didn’t understand the second question.

You’re right (I asked a broad question), but at least let me know the solution for this question, Using macro how to read libre calc file and the paste it to libre draw application (When Libre Draw is running/open)?

This works with the latest LibreOffice 7.x series?

Generally very well, but…

Not exactly everything. But that’s partly due to some bugs or inconveniences already present in old versions “before the split” (OO.o/AOO // LibreOffice).
And as you see in the linked page only “Edition 4.1.” was worked on recently while other usefuil information was not much updated for years now.
On the other hand Andrew never specialised on LibO. What’s described is mostly “common heritage”. LibreOffice, however, fixed a lot of bugs, changed the UI in many places, and added a lot of features.
Nonetheless Andrew’s texts help a lot in many cases (even if not speciafically Basic is concerned, but the API is at the center of an issue).

In cases of doubt concerning the API check LibreOffice: Main Page using the search tool.

1 Like

I enabled the record macro option in Advanced but still, Record macro option is not showing in LibreOffice Draw.

Is this what supposed to be or are there any more steps?

OOO Dev Tools should be able to accomplish these tasks.
Calc - Chapter 21. Extracting Data

Draw - Chapter 13. Drawing Basic Shapes

Draw formatting - Draw Formatting and Style.

These references contain links to working examples.
Checkout Also: Live LibreOffice Python UNO Examples

This of course will require some development skills.

1 Like

Draw doesn’t support the macro recorder. And the remark “may be limited” is a gross understatement.
Anyway recorded macros aren’t a good start into studying programming for LibreOffice documents. They are something next to an independent tool only losely linked to the API via two services, and only capable of executing a very limited list of .uno: commands getting the modifying information (arguments) they need partly via the CurrentSelection partly via ugly and bloated structures not cleanly nor completely specified. There are some reasonable use-cases, however. You will find out something about them later.

The macro Recorder work in the Calc and in the Writer only.
The macros WRITTEN based on the API functions will work in Calc, Writer, Draw, and in Impress too.