Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active October 20, 2021 19:49
Show Gist options
  • Save bjoerntx/3ec98f713d572bb39ca7c64d52a2fe23 to your computer and use it in GitHub Desktop.
Save bjoerntx/3ec98f713d572bb39ca7c64d52a2fe23 to your computer and use it in GitHub Desktop.
private void Mm_BlockRowMerged(
object sender,
TXTextControl.DocumentServer.MailMerge.BlockRowMergedEventArgs e) {
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {
tx.Create();
tx.Load(e.MergedBlockRow, TXTextControl.BinaryStreamType.InternalUnicodeFormat);
// find all tables in a block and flag cell 1,1
if (tx.Tables.GetItem() != null) {
tx.Tables.GetItem().Cells.GetItem(1, 1).Name = "block_identifier";
}
byte[] data;
tx.Save(out data, TXTextControl.BinaryStreamType.InternalUnicodeFormat);
e.MergedBlockRow = data;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment