Unlink sections

Jun 2, 2015 at 4:55 PM
Edited Jun 2, 2015 at 9:35 PM
Is there a way to unlink a section of previous?

I insert a section in a document and i want start the page number at the second section, but i not find a way to do this.
I thought that could be the SectionBreakType, but don't worked.
Someone know a way to do this?
Jun 4, 2015 at 2:40 AM
Edited Jun 4, 2015 at 2:42 AM
Well, i solved my problem adding to my project the microsoft.office.interop.word library. I created a file with docx (because it's great) and after i edited the section (unlinked to the previous) with the microsoft library. I use this code:
      Microsoft.Office.Interop.Word.Application winword =
    new Microsoft.Office.Interop.Word.Application();
           winword.Visible = false;
           object missing = System.Reflection.Missing.Value;
           Microsoft.Office.Interop.Word.Document document = winword.Documents.Open(caminho + @"\" + nomeProjeto + ".docx");

           object lastLine = Microsoft.Office.Interop.Word.WdGoToItem.wdGoToLine;
           object lastDirection = Microsoft.Office.Interop.Word.WdGoToDirection.wdGoToLast;
           document.Sections[2]
               .Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].LinkToPrevious = false;
           document.Sections[2]
               .Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage].LinkToPrevious = false;
           document.Sections[2]
               .Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages].LinkToPrevious = false;
               document.Sections[2]
               .Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].PageNumbers.Add(15);
               document.Sections[2]
                   .Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].PageNumbers.RestartNumberingAtSection=true;
               document.Sections[2]
                   .Headers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].PageNumbers.StartingNumber=contadorPaginas;
           document.Sections[2]
               .Footers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].LinkToPrevious = false;
           document.Sections[2]
               .Footers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage].LinkToPrevious = false;
           document.Sections[2]
               .Footers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterEvenPages].LinkToPrevious = false;
           document.Sections[2]
               .Footers[Microsoft.Office.Interop.Word.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text = "";
           winword.Selection.GoTo(ref lastLine, ref lastDirection, ref missing, ref missing);
           winword.Selection.EndKey(Microsoft.Office.Interop.Word.WdUnits.wdStory, missing);

           document.SaveAs(caminho + @"\" + nomeProjeto + ".docx");
           document.Close();
           winword.Quit();
I hope that could help someone that is looking for a way to do the same.
Marked as answer by thiagomsilva on 6/3/2015 at 7:42 PM