Question: how to find out page number of match inside IReplacingCallback.Replacing

Hi Guys,

We are using IReplacingCallback.Replacing method for .NET in our product in a “search and replace in word documents” use case, and we need to determine the page number of the match that triggers the callback.

I did some digging but no success so far.

Any ideas, hints would be greatly appreciated on this!

Thanks,
Zoltan

@zpopswat

In IReplacingCallback.Replacing, you can use LayoutCollector.GetStartPageIndex method to get the page number of matched node. Please pass the matched node to this method that you can get using ReplacingArgs.MatchNode property.

1 Like