title: Openxml Add another different footer to an existing docx
body: <p>I am trying to add a different footer after each altchunk is added.  But my code changes all footers and on last page there are two footers.  I am adding a section break prior to adding the new footer with a different text.   (C# and OpenXml)</p>
  
  <pre><code>    public static void AppendFooter(string sFtText, string sFile)
      {
          using (WordprocessingDocument wdDoc = WordprocessingDocument.Open(sFile, true))
          {
              MainDocumentPart myPart = wdDoc.MainDocumentPart;
              FooterPart newFtPart = myPart.AddNewPart&lt;FooterPart&gt;();
              string ft_ID = myPart.GetIdOfPart(newFtPart);
  
              MakeFooterPart(sFtText).Save(newFtPart);
              foreach (SectionProperties sectProperties in
                      myPart.Document.Descendants&lt;SectionProperties&gt;())
              {
                   FooterReference newFtReference =
                    new FooterReference() { Id = ft_ID, Type = HeaderFooterValues.Default };
                  sectProperties.Append(newFtReference);
              }
              //  Save the changes to the main document part.
              myPart.Document.Save();
          }
      }
  </code></pre>
  
  <p>////////////////////////////////////////////</p>
  
  <pre><code>    private static Footer MakeFooterPart(string FooterText)
      {
          var element =
            new Footer(
              new Paragraph(
                new ParagraphProperties(
                  new ParagraphStyleId() { Val = "Footer" }),
                new Run(
                  new Text(FooterText))
              )
            );
  
          return element;
      }
  </code></pre>