Does your Heading 1 style include page-break-before formatting or space-before/after? If so, running this will likely change the pagination. You are working with the selection object rather than the range object. This will always be slower.

It would help if you could include a link to a sample document with the problem. Here is my article on the Microsoft site on the how and why of doing so.