I have added Mail Merge field and and try to add checkbox property using Telerik word processing. but not able to find the solution. and not able to extract Mail Merge fields also from word document.
1 Answer, 1 is accepted
0
Yoan
Telerik team
answered on 05 Apr 2023, 01:35 PM
Hello Roshni,
1. In order for me to get more context about the expected checkbox property and be able to give you some specifics, would you be able to provide more details regarding the expected use, environment, and implementation of the checkbox?
2. The Merge Fields can be obtained by utilizing the EnumerateChildrenOfType and passing the FieldCharacter for the desired type to it. That returns a collection of 'Start' 'Separator' and 'End' field characters for each of the fields. For easier iteration, this collection can be filtered down to only the 'Start' characters of each field. Each of those characters exposes the Field it is related to by referencing it in the FieldInfo property:
var fieldCharacters = document.EnumerateChildrenOfType<FieldCharacter>().Where(fc => fc.FieldCharacterType == FieldCharacterType.Start);
Field fieldCharacter = fieldCharacters.FirstOrDefault().FieldInfo.Field;
Note: After performing the Mail Merge this functionality will no longer function, because the fields will be replaced by the corresponding text.
For more information on this functionality if you haven't already you can check out the following articles: