I'm using this code to set autonumeration in generated Word doc and it works fine but I need to start numeration from specific value, e.g. page_1 - 3, page_2 - 4, page_3 - 5, etc.
//define currentpage object
object currentPage = WdFieldType.wdFieldPage;
activeWindow.ActivePane.View.SeekView = WdSeekView.wdSeekCurrentPageFooter;
//set alignment
activeWindow.ActivePane.Selection.Paragraphs.Alignment = WdParagraphAlignment.wdAlignParagraphLeft;
//Add page number
activeWindow.Selection.Fields.Add(activeWindow.Selection.Range, ref currentPage, ref oMissing, ref oMissing);
In Word you can set it by "Insert->Page Number->Format Page Numbers->Start at" Is there equivalent property in C# for this?
Solved! All we have to do is set this 2 property:
activeWindow.ActivePane.Selection.HeaderFooter.PageNumbers.RestartNumberingAtSection = true;
activeWindow.ActivePane.Selection.HeaderFooter.PageNumbers.StartingNumber = 666;