ID and Name Properties for Images and Text Frames
Version 15.1 adds ID and Name properties to text frames and images in TX Text Control .NET for Windows Forms. Developers can now retrieve specific frames by name using the GetItem method, and these properties persist correctly when documents are saved to DOCX, DOC, or RTF.

One of the most commonly requested features since the release of version 15.0 is the possibility to store additional information for images and text frames.
Version 15.1 implements an ID and a Name property for these frame-based objects. These properties helps you to find an image or frame based on a specific name. In previous versions, there was no way to get a specific text frame out of the document, though it was possible to iterate through all frames using it's collection. But now, you can use the GetItem method to retrieve a specific text frame.
Consider the following scenario: A text frame is inserted into a template that contains the recipient's address on a letter. During the merge process, you simply need to find that text frame based on it's Name in order to update the text.
The Name property is also compatible to other supported formats like DOCX, DOC or RTF and will be maintained after saving to these formats.
The following code inserts a text frame with the name recipient. It shows that the Name property is maintained after saving as DOCX. Using the GetItem method, the text frame can be retrieved in order to update it's text.
// [C#]
TextFrame frame = new TextFrame(new Size(2000, 2000));
frame.Name = "recipient";
textControl1.TextFrames.Add(frame, -1);
// save as DOCX and reload to prove that the Name is maintained
byte[] data;
textControl1.Save(out data, BinaryStreamType.WordprocessingML);
textControl1.ResetContents();
textControl1.Load(data, BinaryStreamType.WordprocessingML);
textControl1.TextFrames.GetItem("recipient").Selection.Text = "TX Text Control";Related Posts
Inserting Images from Memory
TX Text Control .NET for Windows Forms supports loading images from files in various formats, but some workflows require inserting images that exist only in memory. This sample application…
Image Improvements in Version 12.0
Text Control published an overview of the image handling improvements in TX Text Control 12.0. The page covers new image wrapping styles, updated user interface elements, and tabbed dialog boxes…
Changing the Image Format Order in the 'insert Image Dialog'
The insert image dialog in TX Text Control .NET for Windows Forms reads available image formats from the tx11_ic.ini configuration file in the BIN folder. Rearranging the entries in this file…
Embedding Images in Various Formats
Documents containing BMP or WMF images grow in size when exported to Word or RTF formats because those formats use uncompressed data. TX Text Control .NET for Windows Forms reduces file sizes by…
