title: Generate word document in landscape mode
body: <pre><code>using (MemoryStream generatedDocument = new MemoryStream())
  {
     using (WordprocessingDocument package = WordprocessingDocument.Create(generatedDocument, WordprocessingDocumentType.Document))
     {
        MainDocumentPart mainPart = package.MainDocumentPart;
  
        if (mainPart == null)
        {
           mainPart = package.AddMainDocumentPart();
           new DocumentFormat.OpenXml.Wordprocessing.Document(new DocumentFormat.OpenXml.Wordprocessing.Body()).Save(mainPart);
        }
  
        HtmlConverter converter = new HtmlConverter(mainPart);
        DocumentFormat.OpenXml.Wordprocessing.Body body = mainPart.Document.Body;
  
        var paragraphs = converter.Parse(docbody);
  
        for (int y = 0; y &lt; paragraphs.Count; y++)
                          {
                              body.Append(paragraphs[y]);
                          }
  
        mainPart.Document.Save();
     }
  </code></pre>
  
  <p>This in the snippet of my code which is used to generate my word document, the document is generated in portrait orientation mode i want the page to be in landscape mode . So can you please suggest me where to use the above code which u have given.</p>