0
Je dois ouvrir un modèle, ajouter du texte, puis l'enregistrer sous un nouveau nom. Comment puis-je l'enregistrer sous un nouveau nom?Comment puis-je enregistrer en tant que word.docx en ouvert xml
String Dir = @"F:\template.docx";
WordprocessingDocument wordprocessingDocument = WordprocessingDocument.Open(Dir, true);
Body body = wordprocessingDocument.MainDocumentPart.Document.Body;
Paragraph paragraph1 = body.AppendChild(new Paragraph());
Run run1 = new Run();
RunProperties runProperties1 = new RunProperties();
Bold bold2 = new Bold();
FontSize fontSize2 = new FontSize() { Val = "28" };
runProperties1.Append(bold2);
runProperties1.Append(fontSize2);
Text text1 = new Text();
text1.Text = "text";
run1.Append(runProperties1);
run1.Append(text1);
paragraph1.Append(Hearder1);
paragraph1.Append(run1);
wordprocessingDocument.Close();
Je crois que son été ansvered [ici] (https://stackoverflow.com/questions/8818160/save-modified-wordprocessingdocument-to-new-file). –
Copie possible de [Enregistrer le fichier Wordprocessing modifié dans le nouveau fichier] (https://stackoverflow.com/questions/8818160/save-modified-wordprocessingdocument-to-new-file) – elgonzo