Determining Page Number Position of a given Paragraph, Table, or Image in Word Document using C# Java

I have the same question about determining the page number of a given Paragraph, Table, or Image. The link you referred to is not valid.

@hoppyjr,

Please check:

For example, you can meet this requirement by using the following code;

Document doc = new Document("E:\\Temp\\in.docx");

Paragraph targetPara = doc.FirstSection.Body.FirstParagraph;
Shape targetShape = (Shape)doc.FirstSection.Body.GetChildNodes(NodeType.Shape, true)[0];

LayoutCollector collector = new LayoutCollector(doc);

Console.WriteLine(collector.GetEndPageIndex(targetPara));
Console.WriteLine(collector.GetEndPageIndex(targetShape)); 

Hope, this helps.

This worked out great thanks.