Voila un exemple de code cela vous aidera peut etre à m'aider :p lol
// 1 avec XmlDocument
using (System.IO.
Stream oStream = oPackagePart.GetStream()){
System.Xml.
XmlDocument oXmlDocument;oXmlDocument =
new System.Xml.
XmlDocument();System.Xml.
XmlElement oXmlElementDocument = oXmlDocument.CreateElement(
"w:document");System.Xml.
XmlElement oXmlElementBody = oXmlDocument.CreateElement(
"w:body");System.Xml.
XmlElement oXmlElementParagraph = oXmlDocument.CreateElement(
"w:p");System.Xml.
XmlElement oXmlElementRun = oXmlDocument.CreateElement(
"w:r");System.Xml.
XmlElement oXmlElementText = oXmlDocument.CreateElement(
"w:t");System.Xml.
XmlText oXmlText = oXmlDocument.CreateTextNode(
"ouiiiiiiiiiii");oXmlDocument.AppendChild(oXmlElementDocument);
oXmlElementDocument.AppendChild(oXmlElementBody);
oXmlElementBody.AppendChild(oXmlElementParagraph);
oXmlElementParagraph.AppendChild(oXmlElementRun);
oXmlElementRun.AppendChild(oXmlElementText);
oXmlElementText.AppendChild(oXmlText);
oXmlDocument.Save(oStream);
oPackage.Flush();
oPackage.Close();
}
//2 avec XmlWriterSystem.Xml.
XmlWriter oXmlWriter;System.Xml.
XmlWriterSettings oXmlWriterSettings;
oXmlWriterSettings =
new System.Xml.XmlWriterSettings();oXmlWriterSettings.Indent
true;oXmlWriterSettings.Encoding System.Text.
Encoding.UTF32;oXmlWriter = System.Xml.
XmlWriter.Create(oPackagePart.GetStream(), oXmlWriterSettings);oXmlWriter.WriteStartElement(
"w:document");oXmlWriter.WriteStartElement(
"w:body");oXmlWriter.WriteStartElement(
"w:p");oXmlWriter.WriteStartElement(
"w:r");oXmlWriter.WriteElementString(
"w:t",
"ouiiiiiiiiiiiiiiii");oXmlWriter.WriteEndElement();
oXmlWriter.WriteEndElement();
oXmlWriter.WriteEndElement();
oXmlWriter.WriteEndElement();
// rootoXmlWriter.Close();