[Solved] Scale picture in merged Calc cells

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
FDB
Posts: 11
Joined: Mon Oct 16, 2023 3:36 pm

[Solved] Scale picture in merged Calc cells

Post by FDB »

In a calc document I have a merged area (multiple columns and rows) where a picture is to be placed. This picture will need scaling. Therefor I want to find out the size of the merged area.
The scaling (and repositioning, if needed) is to happen in a (basic) macro.
So far I was not able to find a strategy/ example.
Need help.
Last edited by MrProgrammer on Wed Apr 24, 2024 7:32 pm, edited 3 times in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
OpenOffice 4.1.14
OSX 10.14.6 (Mojave)
JeJe
Volunteer
Posts: 2785
Joined: Wed Mar 09, 2016 2:40 pm

Re: Scale picture in merged Calc cells

Post by JeJe »

Select the cells, then:

Code: Select all

thiscomponent.currentselection.size
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
User avatar
Zizi64
Volunteer
Posts: 11364
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Scale picture in merged Calc cells

Post by Zizi64 »

The recent LibreOffice versions have a built-in feature for resizing the images: "Fit to cell size". It works for me with merged cells too.
FitToCellSize.png
FitToCellSize.png (19.71 KiB) Viewed 693 times
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Post Reply