Welcome to OpenXML Developer Sign in | Join | Help

Custom WordML attributes?

Last post 10-10-2008, 3:34 AM by maets. 1 replies.
Sort Posts: Previous Next
  •  10-10-2008, 3:27 AM 3778

    Custom WordML attributes?

    Hi, is it possible to assign custom attributes to elements in document.xml,
    that Word itself will ignore, so that I programmatically can find the exact
    XmlNode I'm looking for.
    (in this case a <w:tbl> table-element)

    Eg.

    foreach (XmlNode n in myXmlDocument.SelectNodes("//w:tbl", myNameSpaceManager))
    {
           foreach (XmlAttribute a in n.Attributes)
           {
                    if (a.Name.Equals("MyCustomAttribute"))
                           // Do something
           }
    }


  •  10-10-2008, 3:34 AM 3779 in reply to 3778

    Re: Custom WordML attributes?

    Nevermind folks, this should work, my code failed prior due to a spelling error :)
View as RSS news feed in XML