Hi,
I'm trying to add a MailMerge-Function for 2D-barcodes. For that I add Images to the WP-Document and set some properties similar to a MailMerge-Field to resolve them programatically when I'm printing the document.
To distinquish normal pictures from "MailMerge-Barcode-Pictures" I want to set the TWpTextObj.Source (to use a command similar to MailMerge-Fields) and the Params to store a default text used for the barcode.
I use the following code to add the Image:
// Create a TWPOImage with a certain bitmap BarcodeObject := TWPOImage.CreateImage(welRichText.Memo.RTFData, BarcodeBitmap); BarcodeObject.WriteRTFMode := wobBoth; BarcodeObject.WidthTW := MulDiv(BarcodeBitmap.Width, 1440, WPScreenPixelsPerInch); BarcodeObject.HeightTW := MulDiv(BarcodeBitmap.Height, 1440, WPScreenPixelsPerInch); X := welRichText.GetXPositionTw; BarcodeTextObj := welRichText.TextObjects.Insert(BarcodeObject); if BarcodeTextObj <> nil then begin // Speichern der Werte zum verknüpfen der Grafik mit dem Mailmerge: BarcodeTextObj.Name := AFullFieldName; BarcodeTextObj.Params := ASampleText; BarcodeTextObj.Source := MFB_Barcode_Ident[ABarcodeType]; BarcodeTextObj.Mode := BarcodeTextObj.Mode + [wpobjRelativeToParagraph];
When I check the parameters immediatly after adding the object everything is fine.
After saving the document to a stream with
and reloading it again into the editor the Params- and Source-Property of the TwpTextObj are empty.
What do I need to do that those properties are also saved for a TwpTextObj with the ObjType wpobjImage?
Thank you for your help
Daniel