Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

loop through xdocument openxml

loop through xdocument openxml

loop through xdocument openxml

<w:p w:rsidR="00C72E37" w:rsidRDefault="00A27CF8" w:rsidP="00A27CF8">
<w:pStyle w:val="Description"/>
<w:r w:rsidRPr="00686C21">
<w:rStyle w:val="Habit"/>
<w:t>Trees, shrubs, lianas or herbaceous vines</w:t>

<w:p w:rsidR="00C72E37" w:rsidRDefault="00A27CF8">
<w:ind w:right="19"/>
<w:r w:rsidRPr="00A27CF8">
<w:rStyle w:val="Family"/>

I need to loop through every <w:P> of the document
First need to find out it’s child <w :pPr> has child <w:pStyle> that contain w:val and get its value and <w:t>Trees, shrubs, lianas or herbaceous vines</w:t>
Then look at <w:P>’s other <w:r> children and find out if it’s any of child has
<w:rStyle w:val="name"/> and get it’s value and <w:t>SAPINDACEAE</w:t> value

So the result in key value dictionary

Style=” Description” : Text = “ Description”
Style = “Habit” : Text= ” Trees, shrubs, lianas or herbaceous vines”
Style= “Family” : Text = “SAPINDACEAE”

I’m using openxml document xdoument I need to find it's every style and their content from every <w:P>
And their text value
If some you know better way then please help me

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close