none
How to update a SimpleField in Word ? RRS feed

  • Question

  • Hi everybody,

    I've a got a template document with several field code (SimpleField in OpenXml SDK 2.0) and I would like to update some of them. The SimpleField class doesn't have such method :-( So how can i do (I'm particularly interested in updating the Date field).

    Besr regards and happy new year !
    Thursday, December 31, 2009 2:26 PM

Answers

  • Hello Phil,

    See if the following discussion helps for your question,
    http://openxmldeveloper.org/forums/thread/962.aspx

    We can call SelectNodes to get the w:fldSimpleField at "instr="Date"". And then we can update it by changing the w:r//w:t child elements value.


    Best regards,
    Ji Zhou
    MSDN Subscriber Support in Forum
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by PhilTheGap Monday, January 4, 2010 10:32 AM
    Monday, January 4, 2010 7:34 AM
    Moderator

All replies

  • Hello Phil,

    See if the following discussion helps for your question,
    http://openxmldeveloper.org/forums/thread/962.aspx

    We can call SelectNodes to get the w:fldSimpleField at "instr="Date"". And then we can update it by changing the w:r//w:t child elements value.


    Best regards,
    Ji Zhou
    MSDN Subscriber Support in Forum
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by PhilTheGap Monday, January 4, 2010 10:32 AM
    Monday, January 4, 2010 7:34 AM
    Moderator
  • Hi Ji,

    I had this solution in mind, as a fallback... I thought that an "Update" method would be available for all kind of fields.
    Thank you !
    Monday, January 4, 2010 10:32 AM