VBA: Word Application.WindowSize event does not work on Mac

Eugene Z 20 Reputation points
2025-06-18T14:50:18.08+00:00

I have implemented Word Application.WindowSize event, according to pages

https://learn.microsoft.com/en-us/office/vba/api/word.application.windowsize

and

https://learn.microsoft.com/en-us/office/vba/word/concepts/objects-properties-methods/using-events-with-the-application-object-word

It works great on the Windows platform.

On the Mac platform the WindowSize event is never triggered.

What changes are needed for the WindowSize event to work on Mac?

Developer technologies | VB
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Varsha Dundigalla(INFOSYS LIMITED) 3,725 Reputation points Microsoft External Staff
    2025-11-14T13:10:35.1733333+00:00

    Thanks for reaching out.

    Microsoft’s documentation describes the event generically, but platform differences in Word for Mac’s VBA/event surface mean some Windows events are not raised on macOS.

    This event works on Windows, but Word for Mac does not raise Application.WindowSize. There’s no VBA project or code change that will enable it on macOS; it’s simply not implemented on that platform.

    • Don’t rely on resize hooks on Mac. Move any logic you tied to WindowSize to events that do fire cross‑platform (e.g., DocumentChange, WindowActivate) or to explicit user actions (button/shortcut). This won’t detect a live resize, but it keeps behavior portable.
    • Periodic check (only if essential). If you must react to window geometry changes, poll ActiveWindow.Left/Top/Width/Height while the document is active and compare with previous values, then call your handler when they change. Word VBA on Mac has no built‑in timer like Excel’s Application.OnTime, so you’d need an external driver (e.g., AppleScriptTask) to tick. Keep the interval conservative to avoid UI jitter.
    • Consider add‑ins if you need richer UX. VSTO isn’t supported on Mac; Office JavaScript add‑ins are cross‑platform, but they also don’t expose a window-resize event in Word—so you’ll still need a different trigger/UX pattern.

    References

    • Microsoft Q&A — VBA: Word Application.WindowSize event does not work on Mac (reports/confirmation) [stackoverflow.com]
    • Word:mac developer notes on VBA platform differences (events/UI capability gaps) [learn.microsoft.com]

    Please let us know if you require any further assistance, we’re happy to help.

    If you found this information useful, kindly mark this as "Accept Answer".


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.