I have a problem with using IF fields with nested FILLIN fields in word merge functionality. If I have FILLIN field in FalseText and in TrueText parts of IF field then document should ask one time to fill FILLIN field (according to the IF field result). But I cannot see that FalseText of IF field have FILLIN field or TrueText have FILLIN field or both. FalseText or TrueText property of IF field show me empty string when it has any field. I can only see all field code for IF field statement. Does aspose api have some functionality to get content of TrueText and FalseText for IF field with nested FILLIN fields?
FILLIN field is not a merge field that is why Aspose.Words mail merge engine skips it. However, when you update fields using Document.UpdateFields method, the following handler will be called for each FILLIN field found in your template:
Document doc = new Document("E:\\Temp\\Fillin.docx");
doc.FieldOptions.UserPromptRespondent = new HandlePrompts();
doc.UpdateFields();
doc.Save("E:\\Temp\\19.4.docx");
public class HandlePrompts : IFieldUserPromptRespondent
{
public string Respond(string promptText, string defaultResponse)
{
// User response (i.e. confirmed value contained in the prompt window).
Console.WriteLine("Please enter value for FILLIN field (" + promptText + "): ");
return Console.ReadLine();
}
}
The above code will prompt user to enter values for each FILLIN field. Hope, this helps
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.