In my mail merge template I would like to have a picture of a certain size, say 200x200 pixels. But the images in my data source have varying size, e.g. 300x220, 600x400, etc
Is it possible to have WPTools automatically scale the pictures proportionally when executing the mail merge?
What I already achieved is to offer special mail merge fields e.g. PIC200_200, PIC300_300 and in the code I check which field is currently processed and scale it myself. This can be used for the time being but it has the disadvantage that I have to prepare a number of fields instead of only one and maybe the formats I prepare are not the formats my users want to have.
If you use the event OnMailMergeGetText event to populate the field (or load the image into the already existing image placeholder) you can precisely scale the image.
Not the function of the TWPOBject class:
Scales contents to width / height (twips). Optionally the contents width and height is used
This is also interesting but actually not what I wanted since your solution has to be done at compile time. I need flexibility at run-time instead.
For example, I would like the user of my program to be able to do the following: add a mail merge picture of size 100x100 somewhere in the document. Another user may want to have a picture of size 200x100.
I think what's missing is that the user can define the size of a mail merge field at run-time.