We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

ASK field code update


Referring to this https://forum.aspose.com/t/57142

I would like to update ASK field code. However, i use the code provided in the post above and i could not make it work.

Here’s the field code extract using method below:
ASK date “What is the date?” \d “5th May 2013” \* MERGEFORMAT

Kindly refer to this Url for my code : http://pastebin.com/embed_iframe.php?i=ftRPhdap

I have enclosed the docx file. I’m new to Aspose and any advice is appreciated.

Hi Yew,

Thanks for your inquiry. In case you are using an older version of Aspose.Words, I would suggest you please upgrade to the latest version (v13.4.0) from here:

The ASK and FILLIN fields are the examples of fields that prompt the user for some response. Please implement IFieldUserPromptRespondent interface and assign it to the UserPromptRespondent property to establish interaction between field update and the user.

IFieldUserPromptRespondent.Respond method returns a response from the user on prompting. Your implementation should return null to indicate that the user has not responded to the prompt (i.e. the user has pressed the Cancel button in the prompt window).

Please use the following code snippet to achieve your requirements. Hope this helps you.

public class HandlePrompts : IFieldUserPromptRespondent<o:p></o:p>


public string Respond(string promptText, string defaultResponse)


// User response (i.e. confirmed value contained in the prompt window).

if (promptText == "What is the date?")

return DateTime.Now.Date.ToString("dd MM yyyy");


return defaultResponse;



//Open document

Aspose.Words.Document doc = new Aspose.Words.Document(MyDir + "in.docx");

doc.FieldOptions.UserPromptRespondent = new HandlePrompts();


//save output document

doc.Save(MyDir + "Out.docx");

Thank you Tahir, you have saved my day. :slight_smile:

Hi Yew,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.