none
Get page number for current paragraph RRS feed

  • Question

  • Hi;

    I want to get the number of page of current paragraph for WORD document in Visual C# 2010, thanks for your help


    • Edited by Elqasim Friday, May 5, 2017 10:27 PM
    Friday, May 5, 2017 10:26 PM

All replies

  • Hello,

    We could use Range.Information Property (Word) to get page number for current selection.

    E.g.

             var i = Globals.ThisAddIn.Application.Selection.Range.Information[Microsoft.Office.Interop.Word.WdInformation.wdActiveEndPageNumber].ToString();
                MessageBox.Show(i);

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 8, 2017 7:04 AM
    Moderator