Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MS-Word Content Change Event

72 views
Skip to first unread message

Thomas Sinclair

unread,
May 9, 2009, 11:23:06 PM5/9/09
to
Hi, Everyone

I am working on a Microsoft Word Add-in and need a shove in the right
direction, please.

I need to build a feature that is technically equivalent to the Microsoft
Word spell checker. That is, it needs to do some work (in a separate thread)
as the user types.

I haven't been able to find an event or technology that I can use to trap
changes that are made to the document either through keystrokes or
otherwise.

Things I have looked at are:
> Events in the Document, Content, Window, Pane, View, and Range objects.
> Using SetWindowsHookEx(WH_KEYBOARD_LL, ... to trap keyboard events. This
should work but I will try working within MS-Word first.
> The Selection change events.
> The Application has a document change event but as I understand it, that
doesn't mean the document content.

PS: We are using VB6 macro's, along with VSTO 2005 with C# but I don't mind
using anything as long as I can get it working.

Thanks & Kind Regards,
Tom

Tony Jollans

unread,
May 10, 2009, 6:55:00 AM5/10/09
to
This is very difficult to do. There is no way directly in Word - or no
practical way (you could, I guess, assign a macro to every key
combination) - to trap every keystroke. About the closest is the Application
WindowSelectionChange event but this does not fire when simply typing.

--
Enjoy,
Tony

www.WordArticles.com

"Thomas Sinclair" <TomM...@community.nospam> wrote in message
news:A5FE864A-761A-4601...@microsoft.com...

Cindy M.

unread,
May 11, 2009, 4:13:16 AM5/11/09
to
Hi Thomas,

> > Using SetWindowsHookEx(WH_KEYBOARD_LL, ... to trap keyboard events. This
> should work but I will try working within MS-Word first.
>

I think this is the only way you can do it, outside of using VBA KeyBindings

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

0 new messages