92b5fc41b47cbf72ee66b18bcd0042bc112eee97
LibreOffice Image Macro
Vkladá obrázky do buniek LibreOffice Calc.
Použitie
- Otvorte
znova.ods, pri výzve povoľte makrá. - Na hárku Vyber vyplňte stĺpec H cestou k obrázku a stĺpec I odkazmi na cieľové bunky (napr.
Vysledok.B5), voliteľný stĺpec J udáva výšku v pixeloch pri zachovaní pomeru strán. - Spustite makro: Stlačte tlačidlo.
Opätovné spustenie vymaže všetky predtým vložené obrázky a prekreslí ich.
Pridanie tlačidla na spustenie makra
Tlačidlo môžete pridať priamo na hárok/stránku a spúšťať makro jedným kliknutím. Funguje v Calc, Writer aj Draw.
- Otvorte dokument.
- Prejdite na Zobraziť → Panely nástrojov → Ovládacie prvky formulára.
- Na paneli Ovládacie prvky formulára zapnite Režim návrhu.
- Kliknite na ikonu Tlačidlo.
- Ťahaním umiestnite tlačidlo na hárok alebo stránku.
- Kliknite pravým tlačidlom na tlačidlo a vyberte Vlastnosti ovládacieho prvku.
- Na karte Všeobecné nastavte text tlačidla v poli Popisok.
- Prejdite na kartu Udalosti.
- Vedľa položky Spustiť akciu kliknite na tlačidlo ….
- Vyberte svoje makro: Moje makrá alebo váš dokument → knižnica → modul → názov makra.
- Kliknite na OK a zatvorte okno vlastností.
- Vypnite Režim návrhu.
- Kliknutím na tlačidlo spustíte makro.
Inserts images into LibreOffice Calc cells based on a mapping table.
Usage
- Open
znova.ods, enable macros when prompted. - On the Vyber sheet, fill column H with image file paths and column I with destination cell references (e.g.
Vysledok.B5) and optional column J is for heigh in pixels while keeping the aspect ration. - Run the macro: Press the button.
Running again clears all previously inserted images and re-draws them.
Adding a Button to Run the Macro
You can add a push button directly to your sheet/page that runs the macro with a single click. This works in Calc, Writer, and Draw.
- Open your document.
- Go to View → Toolbars → Form Controls.
- Turn on Design Mode on the Form Controls toolbar.
- Click the Push Button icon.
- Drag on the sheet/page to place the button.
- Right-click the button → Control Properties.
- In the General tab, set the button text in the Label field.
- Go to the Events tab.
- Next to Execute action, click the … button.
- Select your macro:
- My Macros or your document → library → module → macro name.
- Click OK, then close the properties window.
- Turn Design Mode off.
- Click the button to run the macro.
Description
Languages
Python
100%