Anyone who knows anything about "Subclassing" and "Hooking"

A

Alex Murray

Can anyone tell me more information about "Subclassing" or "Cross-Process
Subclassing" and "Hooking" please?

From what I understand it can be used for intercepting Windows Messages by
getting into the message queue, which is exactly what I need to do.

I need to use it in VBA to stop a "Do you want to save?" question appear
when I close an IE window that has a Word 2000 document automated into it.
(That is, it's opened the Word Document in IE with all the standard Word
buttons/menus etc.)

Could anybody help with this at all? I've been on this now for 6 days, and
I'm on the point of going insane as my manager is telling me that it MUST be
done!!! Argh!

cheers.

muzz
 
J

Jonathan West

Hi Alex,

Well, the obvious way to suppress that dialog is to set the document's Saved
property to True just before closing. Then Word thinks the document doens't
need to be saved and it closes the document without saving and without the
prompt.

Almost all the tricks for subclassing and hooking that you will find in
books & on the web are for VB Forms, not for VBA UserForms. Although they
are superficially similar, they are in fact completely different beasts.
Userforms and their controls lack most of the hooks that make it possible to
do subclassing tricks. Most notably, UserForms don't offer a window handle
property. You *can* get a window handle using the Windows API, but it is
tricky to do.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top