How to Select Drop Down List in word document us Open XML Word document in .net

Home Forums Open-Xml-Sdk How to Select Drop Down List in word document us Open XML Word document in .net

Tagged: 

This topic contains 5 replies, has 5 voices, and was last updated by  Nickhaley 3 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3493

    sharif
    Participant

    I tried all my best but can’t figure out how to select a value or item form drop down list in word document using Open XML Word document in .NET.
    for Text replace i am using the following code.
    using (StreamReader sr = new StreamReader(wordDoc.MainDocumentPart.GetStream()))
    {
    docText = sr.ReadToEnd();
    }
    Regex regexText = new Regex(“My text”);
    docText = regexText.Replace(docText, “Hi Everyone!”);

    But I can’t figure out how to select a value or item form drop down list.

    #3512

    Eric White
    Keymaster

    Hi,

    Sorry, I am not fully clear on your scenario. What exactly are you trying to do? Maybe you can state the problem in ‘business terms’ or ‘functionality’.

    Best, Eric

    #3514

    sharif
    Participant

    Hi Eric,

    I am trying to create a word document from a template. The Input data is coming from a webform. In the web form I have got a a dropdown list .lets say the list has the following values for Gender

    Please Select
    Male
    Female
    Unknown

    My word document template has the same list as a dropdown list. Based on the user input how will i be able to access the dropdown list in the word template and set its value to what the user has chosen in the web form.

    How do i access the DropdownList that exist in the word document and change its selection.

    Thanks

    #3856

    balajikarpurapu
    Participant

    Hi Sharif, did you find solution to set drop down list value in word document with Open XML, c#

    #4208

    RobertWet
    Participant

    Just say – Hallo! For all users of this wonderfull forum!

    #4245

    Nickhaley
    Participant

    We are the leading third party yahoo customer service phone number 24/7 toll free 1844-631-2188 for fixing your yahoo email problems. Our yahoo yahoo technical experts provide you the best Support. View More: https://absolutesoftech.com/yahoo-email-tech-support.html

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.