I need to add a style to a paragraph using OpenXML. I have the following code and it's running but, the style is not the one I am trying to add.
var file = WordprocessingDocument.Open(fileName, true);
var text = new Text("Hello world");
var run = new Run(text);
var paragraph = new Paragraph(run);
paragraph.ParagraphProperties = new ParagraphProperties(
new ParagraphStyleId() { Val = "Body Text" });
file.MainDocumentPart.Document.Body.AppendChild(paragraph);
file.MainDocumentPart.Document.Save();
Is there something that I am doing wrong??? How to add some of the existent styles to a paragraph using OpenXML.