Hello all,
I'm looking to write a macro to autoload an image into a field based on the text in another field. To be more specific:
I have a plant ID database with scientific name, and a bunch of other information. I also have a folder with several images of each plant. The image files are named by the scientific name 1, scientific name 2, scientific name 3, etc. When I load the record I want the image fields to automatically look for the image file in a specified folder using the scientific name field as the first part of the file path, and then adding a 1, 2, or 3...
Could anyone break this macro down for a beginner like myself?
Or is it possible to do this by placing a URL path in the "default value" that somehow references the scientific name field and skip the macro?
Thanks,
Steve
Macro to Autoload Image URL per Field Text?
Macro to Autoload Image URL per Field Text?
OOo 3.1.X on Ms Windows XP
Re: Macro to Autoload Image URL per Field Text?
Does this help: how to add images to base, with and without using path.
If this has answered your question please go to your first post and use the Edit button, and add [Solved] to the start of the title. You can use the green tick icon at the same time if you like.
If this has answered your question please go to your first post and use the Edit button, and add [Solved] to the start of the title. You can use the green tick icon at the same time if you like.
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
Gurkha Welfare Trust
Re: Macro to Autoload Image URL per Field Text?
Hi Gurkha,
I was looking at that before I posted, but there's 2 things. Those macros were written before the 3.1 update, and now with 3.1 I can have a text field that stores the path and retrieves the images without the macro (scroll down to the bottom of the thread). I've got that up and running no problem. The other thing missing from that macro is the part that retrieves the text from the "scientific name" field and pastes that into the file path.
Thanks for the help,
Steve
I was looking at that before I posted, but there's 2 things. Those macros were written before the 3.1 update, and now with 3.1 I can have a text field that stores the path and retrieves the images without the macro (scroll down to the bottom of the thread). I've got that up and running no problem. The other thing missing from that macro is the part that retrieves the text from the "scientific name" field and pastes that into the file path.
Thanks for the help,
Steve
OOo 3.1.X on Ms Windows XP
Re: Macro to Autoload Image URL per Field Text?
I'm afraid I can't help further. Hopefully someone more experienced in this will come through this thread soon.
Ubuntu 14.10 Utopic Unicorn, LibreOffice Version: 4.3.3.2
Gurkha Welfare Trust
Gurkha Welfare Trust
Re: Macro to Autoload Image URL per Field Text?
http://development.openoffice.org/releases/3.1.0.html
pics/holyday/beach.png
pics/dog/shit.bmp
pics/cat/scratch.jpg
Seemingly, the developers did not change the way how binary data (such as pictures) are handled. They just modified the image control to accept a text field. The text field is supposed to contain URLs as a pointer to picture files outside the database, relative to the Base document's path.image controls: can be bound to text database columns, interpreting their content as relative link to the image i91310 feature-info:
Image controls in database forms can now be bound to text columns. Formerly, you could only bind them to columns whose content could reasonably be interpreted as binary (BLOB etc.). Now, when you select a text database column as source for the image control, then it will interpret the content of the respective column's content as URL, and load and display the image pointed to by this URL. Also, the URL might be relative to the document which the image control is embedded into.
pics/holyday/beach.png
pics/dog/shit.bmp
pics/cat/scratch.jpg
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: Macro to Autoload Image URL per Field Text?
hello
This all if I understand you correct.
Romke
You have only to point the data field from your image control to the field of your table which kept the name of the file. I knew people love macros but i"m afraid you can not use them in this case.I was looking at that before I posted, but there's 2 things. Those macros were written before the 3.1 update, and now with 3.1 I can have a text field that stores the path and retrieves the images without the macro (scroll down to the bottom of the thread). I've got that up and running no problem. The other thing missing from that macro is the part that retrieves the text from the "scientific name" field and pastes that into the file path.
This all if I understand you correct.
Romke
LibreOffice 7.1.4.2 on openSUSE Leap 15.2