Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Add computed style to word document on the fly

$
0
0

Hy,

i parse a template to create a docx document, i valorize variables in template and at the end i need to insert style node in document.xml file.But I could notmake it work

innerText = newNode.InnerText;
XmlAttribute attributes= xmldoc.CreateAttribute("w", "instr",field.NamespaceURI);
attributes.InnerText = innertext;
field.Attributes.Append(newAttr);
XmlNode childXmlNode= xmldoc.CreateElement("w", "r",field.NamespaceURI);
childXmlNode=field.AppendChild(childXmlNode);
resultNode = xmldoc.CreateElement("w", "t",field.NamespaceURI);
resultNode .InnerText = innerText;
resultNode  = childXmlNode.AppendChild(tmpNode);
attributes= xmldoc.CreateAttribute("xml:space",field.NamespaceURI);
attributes.Value = "preserve";
resultNode .Attributes.Append(newAttr);

//styleXmlNode ??

I have already try to insert style node before result node and after

The style is correctly defined in styles.xml.

Thanks for the help


www.Photoballot.net


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>