How can I convert a file path to an image in LO Writer using a macro?

asked 2018-07-10 08:32:49 +0200

ColorMePeaceful gravatar image

I am setting up a template to create several documents that include around 100 graphics each.

After creating a Base file with image fields, I learned that mail merge will not work with graphics. Fortunately, I only entered a small bit of information in the fields before finding this out.

As a result, I set out to try to find a workaround. I have spent about two and a half days Googling and have still not been able to find an answer.

I found an extension called Text2Pic, which sounded perfect, but it will not run. I am guessing that perhaps it will not run because it was designed for OOo?

In playing around, I found that I can manually accomplish what I want to do. However, since I will be creating several documents, it would take a crazy amount of time! Therefore, I tried to create a macro and assign a keyboard shortcut. The macro: 1) copies the filename, which is in a frame, from the mail merged file, 2) opens the image dialog, 3) pastes the filename that was copied to the clipboard, and 4) links the file, rather than embedding it.

The problem with the macro is that rather than step 3 working as expected and pasting from the clipboard, the macro captures an absolute value. Is there a way to change the arg Value in the macro from an absolute to a variable (i.e. telling it to pull from the clipboard)?

Or is there a better way to accomplish what I want to do?

Could this beyond the capabilities of the program?

Note: I am using a couple different versions of Writer on a Windows machine.

edit retag flag offensive close merge delete