Tuesday, June 2, 2009

Control the Page Numbering in word document

Hello friends

Here is the sample code using that u can set the page number starting from 5.

Microsoft.Office.Interop.Word._Application oWord oWord = new Microsoft.Office.Interop.Word.Application(); oWord.ActiveWindow.Selection.Sections[1].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].PageNumbers.RestartNumberingAtSection = true;

oWord.ActiveWindow.Selection.Sections[1].Headers[WdHeaderFooterIndex.wdHeaderFooterPrimary].PageNumbers.StartingNumber = 5;

Thanks & Regards
Jignesh Patel

No comments:

Post a Comment