views:

291

answers:

1

I need to enable and disable shortcut key for select all "Ctrl + A".

FindKey(BuildKeyCode(wdKeyControl, wdKeyA)).Disable

FindKey(BuildKeyCode(wdKeyControl, wdKeyA)).Rebind wdKeyCategoryCommand, ??

What is the command parameter for Ctrl + A??

I cannot find this information anywhere!

Also I want to apply it only for my templates: CustomizationContext = ActiveDocument.AttachedTemplate

this doesn't seem to work. it seems to apply to the normal template because if I open any word instance the shortcut key is still disabled.

thank you in advance for your help!

A: 

Entering

 ?FindKey(BuildKeyCode(wdKeyControl, wdKeyA)).Command

in the Immediate Window of the VBA editor shows

 EditSelectAll

so I guess that is what you are looking for.

To your second question: did you check that ActiveDocument.AttachedTemplate is not equal to NormalTemplate when you disabled "Ctrl + A" ?

Doc Brown
Thanks alot! i don't know VBA and this was exactly what i was looking for.
laetitas