I open a Word template from with in Outlook.
The template that has a Public Sub named ClosePreview,
I use this macro to close the Word application by calling Quit
wddonotsavechanges,
this works fine when user clicks the built-in Close button.
If user clicks the X in upper right side my macro will not execute.
Can some one please advise how to trap the event associated with clicking
the "X",
my goal is to close and quit Word with out saving any changes.

Thank you

Re: How to trap ClosePreview, when user clicks the X inupper right corner. by Doug

Doug
Mon Sep 26 02:51:17 CDT 2005

See the article "A Pseudo DocumentBeforeClose Event" at:

http://www.word.mvps.org/FAQs/MacrosVBA/PseudoBeforeClose.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"Harold M Little" <harold.little@verizon.net> wrote in message
news:OjOjjtQwFHA.3556@TK2MSFTNGP12.phx.gbl...
>I open a Word template from with in Outlook.
> The template that has a Public Sub named ClosePreview,
> I use this macro to close the Word application by calling Quit
> wddonotsavechanges,
> this works fine when user clicks the built-in Close button.
> If user clicks the X in upper right side my macro will not execute.
> Can some one please advise how to trap the event associated with clicking
> the "X",
> my goal is to close and quit Word with out saving any changes.
>
> Thank you
>