none
Get and set value of "legacy forms controls" RRS feed

  • Question

  • Hi,

    I'm searching a way to get and set value of "legacy forms controls" using SDK.

    The XML representation of such a control is :

    <w:bookmarkStart w:id="0" w:name="Nom"/>
    <w:r> ... </w:r>
    <w:bookmarkEnd w:id="0"/>

    One of the <w:r> contains a <w:t> node which contains the value of the control.

    So, reading a value seems possible ... but how can I set a value of an empty control ?

    How to know in which <w:r> should I add a <w:t> node ??

    Do you know a better way to do that ?

    Thanks,

    Arnaud

    Wednesday, August 29, 2012 5:59 PM

Answers

  • Hi akam74,

    I think I can't consider book mark as a control here. And the control which defined in SdtBlock or SdtRun will be "Control" in WordpressingDocument. And I didn't think there have different between the documents which create via Word 2007 and Word 2010 of the content controls.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, September 3, 2012 7:14 AM
    Moderator

All replies

  • Hi Arnaud,

    Thanks for posting in the MSDN Forum.

    I think I'm not sure about the mean of "legacy forms controls" in your post. I see you seem to access the content of the bookmark "Nom" in your post. Do you want to enumerate the bookmark which name "Nom" and access the text of this bookmark?

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Friday, August 31, 2012 4:54 AM
    Moderator
  • Hi Tom,

    By legacy forms controls, I mean "old" controls before Word 2007 :

    "Text Form Field, Check box form field ..."

    They are in the developer toolbar, when you click on "Legacy Tools".

    I found a way to parse those controls [1], but according to me, it cannot be industrialized for a real solution.

    The difficulty is that the XML resulting of those controls is not well structured.

    New controls ("Rich text controls") seem better structured with a global <sdt> node.

    What do you think ?

    Thanks,

    Arnaud

    [1] = http://openxmldeveloper.org/blog/b/openxmldeveloper/archive/2011/09/01/how-to-retrieve-the-text-of-a-bookmark-from-an-openxml-wordprocessingml-document.aspx

    Friday, August 31, 2012 1:39 PM
  • Hi akam74,

    I think I can't consider book mark as a control here. And the control which defined in SdtBlock or SdtRun will be "Control" in WordpressingDocument. And I didn't think there have different between the documents which create via Word 2007 and Word 2010 of the content controls.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, September 3, 2012 7:14 AM
    Moderator