Image merge problem after upgrade to 7

  • I'm using WpTools 7.33 in Berlin. After upgrading from V6 (and Delphi XE) my code for mail merging photos no longer seems to work.

    I'm using the following, basically I'm just iterating over the photos, and then using the TWPOImage.LoadFromFile method to replace a placeholder image, which is the bit that no longer seems to work. Any suggestions how I might change the code to be compatible with V7?

    • Offizieller Beitrag

    Hello,

    I assume the image becomes loaded but the width and height is not being assigned.

    The problem is that this code enumerates the TWPOImage instances while that class is just the container for an image, not the object which is actually displaying it. (That would be TWPTextObj)

    I would use the method
    procedure ImageGetList(list: TWPTextObjList; FromAllBlock: Boolean = FALSE);

    Then you could use the TWPTextObj referenced in that list and call LoadFromFile there. The advantage is, that here also a new TWPOImage can be created by the TWPOImage.

    Regards,

    Julian

  • Thanks Julian,

    I've managed to get this working (albeit a bit more verbosely). Also is there an easy way of hiding a TWPTextObj?

    I'm using place-holder images for my picture insert points (so I can control the size and position), but sometimes there is not an image to merge - in these cases it would be nice to make the TWPTextObj invisible.

    Alister