Correct event for detecting a change in the size of a page

Started by ImAPictureFormat, January 09, 2020, 08:09:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ImAPictureFormat

Hi,

I have an Application.CellChanged handler set up that sets shape data, moves children of the shape whose cell caused was changed, etc., when a shape moves. In the case I'm looking at, I have a shape that borders a page break. When I move the shape over the page break, it causes CellChanged events to fire for 1) the PinX and PinY locations of the shape I moved, and 2) for the PageWidth and PageHeight cells of the PageSheet because of the page size change. In my code I need to detect the change in the page width and height, but the CellChanged event for PageSheet.PageWidth and PageSheet.PageHeight fires after the CellChanged for Shape.PinX and Shape.PinY.

I would like to be able to detect the page width/height change before the CellChanged event for the shape's PinX/Y.

From what I've found by googling, the CellChanged event is the right way to capture the page width/height change, but is there a better way to detect the page width/height change?
Alternatively, instead of letting Visio resize the page, could I instead programatically resize it after I handle the CellChanged for the shape PinX/Y?

Thank you!