I have a problem. I created a word document where I used the “Insert” menu and selected “Field” and further selected format “MMMM d, yyyy”. The result is current date in what may look like a formfield but it is not. Save the document as .doc.
I am having trouble reading the date that is in that field. I get the following from .NET debugger:
Text: “ DATE @ “MMMM d, yyyy” March 7, 2005”
I am sorry if I wasn’t clear enough. When I programmatically open said document and try to obtain the Datefield contents I get “ DATE @ “MMMM d, yyyy” March 7, 2005”, which isn’t what I want. Is there any way in which I can obtain the desired information (“March 7, 2005”) from such a field using Aspose.Word?
At the moment the only way to obtain this information from the DATE field is parsing the string you get. Current date is placed between field separator ((char) 20) and field end (char (21)) characters. So simply extract current date from the string.
Parsing like you recommended works. Thanks for the prompt response. But do you plan to make retrieval from such (non-merge/non-form) fields easier in the future? (I sure hope so)
I also have another issue:
Thanks again for resolving my problem.
Yes, we’ll implement this in the future, but now it is difficult to say when exactly.