A
AnthonyHall
I have a Word template that needs to capture keystrokes and format the
text in certain paragraph types. For example it needs to change
letters to italic and numbers to plain.
I am trying to do this by capturing hooking keystrokes with a CBT hook
and then looking to see whether the selection is in a particular
style. The problem is that keystrokes don't always end up in the
document itself. I can check that they are not going to a dialog box
by GetForeground window, I can check that they are not going into a
comments pane using selection.active, and I can check that they aren't
going into mail headers with application.FocusInMailHeader. However
that still leaves the possibility that they are going to a task pane -
for example document properties - or a control on the ribbon or QAT or
a commandbar in pre 2007 versions.
Is there any way I can check for these other possibilities?
(Just to forestall the obvious question - yes, I have also considered
doing this completely differently, by binding the keys to macros. In
fact that's how the template works currently. But it has its own huge
raft of problems)
Thanks for any help
Anthony
text in certain paragraph types. For example it needs to change
letters to italic and numbers to plain.
I am trying to do this by capturing hooking keystrokes with a CBT hook
and then looking to see whether the selection is in a particular
style. The problem is that keystrokes don't always end up in the
document itself. I can check that they are not going to a dialog box
by GetForeground window, I can check that they are not going into a
comments pane using selection.active, and I can check that they aren't
going into mail headers with application.FocusInMailHeader. However
that still leaves the possibility that they are going to a task pane -
for example document properties - or a control on the ribbon or QAT or
a commandbar in pre 2007 versions.
Is there any way I can check for these other possibilities?
(Just to forestall the obvious question - yes, I have also considered
doing this completely differently, by binding the keys to macros. In
fact that's how the template works currently. But it has its own huge
raft of problems)
Thanks for any help
Anthony