none
How to detect Word Shapes resizing RRS feed

Answers

  • Hi Tunisien

    Word offers no events that handle this. Closest you could come would be WindowSelectionChange, which would let you track, for example, what kind of thing is now selection (Selection.Type). If it were a Shape or an InlineShape I suppose you could note that object and the relevant properties. When the event fires again, check whether the properties for that object have changed.

    The thing about WindowSelectionChange is that it fires a lot - every time the user uses arrow keys, Backspace or clicks with the mouse, uses Tab in a table, etc. So working with the event can have an impact on performance.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Tunisian_BB Tuesday, December 4, 2012 9:45 AM
    Tuesday, December 4, 2012 9:32 AM
    Moderator

All replies

  • Hi Tunisian,

    Thanks for posting in the MSDN Forum.

    I will move your thread to Word development forum due to your problem will better support at that place.

    What your say it too general to discuss. In your issue we don't know when you want to find the Shapes' change. And we don't know who want to detect it and who will receive alert when the shape changed.

    I never learned there have a direct way in Word PIA to do that. I think we might do it via Win32 API.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, December 4, 2012 6:31 AM
    Moderator
  • Hi Tom,

    I want to detect when the user re-size a shape using the mouse, after re-sizing I  need to get new shape sizes.

    Regards

    Tuesday, December 4, 2012 8:50 AM
  • Hi Tunisien

    Word offers no events that handle this. Closest you could come would be WindowSelectionChange, which would let you track, for example, what kind of thing is now selection (Selection.Type). If it were a Shape or an InlineShape I suppose you could note that object and the relevant properties. When the event fires again, check whether the properties for that object have changed.

    The thing about WindowSelectionChange is that it fires a lot - every time the user uses arrow keys, Backspace or clicks with the mouse, uses Tab in a table, etc. So working with the event can have an impact on performance.


    Cindy Meister, VSTO/Word MVP, my blog

    • Marked as answer by Tunisian_BB Tuesday, December 4, 2012 9:45 AM
    Tuesday, December 4, 2012 9:32 AM
    Moderator
  • Hi Cindy,

    Thank you for your idea, since Shapes I want to track are pictures in Picture Content Controls I will use ContentControlOnEnter and ContentControlOnExit to check if sizes changed

    Tuesday, December 4, 2012 9:44 AM