title: Cannot Write Multiple Paragraph in Aspose
body: <p>I have an issue when I try to write multiple paragraphs in existing Shape. Only the first paragraph is written. I debug the code and I found that the Shape object as all the paragraphs I want. The problem is when I write to file I found only the first one. I share with you the project code.</p>
  
  <pre><code>class Program
      {
          public static void Run()
          {
  
              string dataDir = ConfigurationManager.AppSettings["directoryToSave"];
              string srcDir = ConfigurationManager.AppSettings["Source"];
              string appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
              string file = Path.Combine(appData, srcDir);
              using (Presentation presentation = new Presentation(srcDir))
              {
                  IMasterLayoutSlideCollection layoutSlides = presentation.Masters[0].LayoutSlides;
                  ILayoutSlide layoutSlide = null;
  
                  foreach (ILayoutSlide titleAndObjectLayoutSlide in layoutSlides)
                  {
                      if (titleAndObjectLayoutSlide.Name == "TITRE_CONTENU")
                      {
                          layoutSlide = titleAndObjectLayoutSlide;
                          break;
                      }
                  }            
  
                  var contenu = File.ReadAllText(@"E:\DemosProject\PF_GEN\PF_GEN\Source\contenu.txt", Encoding.UTF8);
                  IAutoShape contenuShape = (IAutoShape)layoutSlide.Shapes.SingleOrDefault(r =&gt; r.Name.Equals("contenu"));
  
                  ITextFrame txt = ((IAutoShape)contenuShape).TextFrame;
                  txt.Paragraphs.Clear();
                  string[] lines = contenu.Split(new[] { Environment.NewLine }, StringSplitOptions.None).Where(str =&gt; !String.IsNullOrEmpty(str)).ToArray();
                  for (int i = 0; i &lt; lines.Length; i++)
                  {
                      var portion = new Portion();
                      portion.Text = lines[i];
                      var paragraphe = new Paragraph();
                      paragraphe.Portions.Add(portion);
                      txt.Paragraphs.Add(paragraphe);
                  }
                  presentation.Slides.InsertEmptySlide(0, layoutSlide);
                  presentation.Save(dataDir + "AddLayoutSlides_out.pptx", SaveFormat.Pptx);
              }
          }
  
          static void Main(string[] args)
          {
              try
              {
                  var path = ConfigurationManager.AppSettings["sourceAsposeLicensePath"];
                  License license = new License();
                  license.SetLicense(path);
                  Run();
              }
              catch (Exception ex)
              {
                  Console.WriteLine("Error" + ex.Message);
              }
              finally
              {
                  Console.WriteLine("Terminated");
                  Console.ReadKey();
              }
          }
  
      }
  </code></pre>
  
  <p>You can find the ppt file (source file) in the attachement file. (<a href="https://gofile.io/?c=JpBDS8" rel="nofollow noreferrer">https://gofile.io/?c=JpBDS8</a> 1)
  Is there any thing missing in my code?
  Thanks</p>