disable f12 key using word Automation

M

Mangala

HI All,
Iam doing word automation using MFC.In my application ,word document is
opened inside dsoframer controle.(Activex Controle).Need to disable f12 key
which is associated with save as command in word.

Following is the sample code Iam trying with,
Application oApp(pDispApp) ;
oApp.SetCustomizationContext(m_DsoFramer->GetActiveDocument());
LPDISPATCH ldisp = oApp.GetFindKey(123,&covOptf12); // 123 key code for f12
objKeyBinding.AttachDispatch(ldisp);
objKeyBinding.Disable();

It is throwing OleDispatchException.
Please suggest me where Iam going wrong.
Let me know if any other ways to achieve the same.


Thanks,
Mangala
 

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