private class RemoveEmptyRowCallback : IFieldMergingCallback
{
public void FieldMerging(FieldMergingArgs args)
{
if (args.FieldName == "QualTitle" && string.IsNullOrEmpty((string)args.FieldValue))
{
args.Field.Start.GetAncestor(NodeType.Row).Remove();
}
}
public void ImageFieldMerging(ImageFieldMergingArgs args)
{
// Do nothing.
}
}
Code works perfectly for the QualTitle, QualSubTitle, and Qualification, it successfully removes these 3 rows
but I don’t know why is it not working for SkillsAndCompetencies, it is throwing error "Object reference not set to an instance of object, args.Field.Start.GetAncestor returned null " however the structure is the same for both.
Doc is attached for reference
Test.docx (41.3 KB)