Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
apondu apondu is offline
external usenet poster
 
Posts: 2
Default Supressing the ctrl-c and other keys during word automation in automation

Hi,

can someone help me and provide me the information on how to supress
the
default action of the shortcut keys of word during word automation.

I am using C#.Net

I have written a code but it generates a exception "Object Reference
not set
to an instance of a object".

I have posted my code here, can someone take a look at it and help in
understand and help me to get the solution for this

Word._Application app = null;

object c = Word.WdKey.wdKeyC;

object ctrl = Word.WdKey.wdKeyControl;

object mykey = null;

word.KeyBindings.ClearAll();

mykey =
word.KeyBindings.Add(Word.WdKeyCategory.wdKeyCateg oryCommand,"DoSomeThing",app.BuildKeyCode(Word.WdK ey.wdKeyControl,
ref c, ref missing, ref missing),ref missing,ref missing);

Here DoSomething is a dummy function

public void DoSomeThing()
{
}

It would be great if someone could help me.

My mail id is

Thanks for the help

Regards,
Govardhan

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Office Automation through C#.Net (with out save option, ctrl-s and mouse click disabled) apondu Microsoft Word Help 1 July 18th 07 05:47 AM
Word letter automation Tonto Microsoft Word Help 2 December 6th 06 07:04 AM
Word Automation Naga Microsoft Word Help 2 April 18th 06 12:42 AM
Word Automation Naga Microsoft Word Help 4 April 14th 06 07:50 PM
Word automation with asp Jag Microsoft Word Help 0 May 19th 05 03:51 PM


All times are GMT +1. The time now is 04:08 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"