visual studio 2008 - Paste Special in C# vsto Excel -


i working on c# vsto excel application.

whenever user pastes in excel template excel sheet,it pastes cell format along cell data in excel template. want avoid this. googled & came across term paste special.

paste special paste contents , no alter format of current sheet.

i want introduce paste special option in vsto application.

i have code here,

   application.onkey("^v", "pastespecv"); 

but not working... can 1 me ?

  1. download dll http://globalmousekeyhook.codeplex.com/
  2. add reference mousekeyboardactivitymonitor.dll

        private keyboardhooklistener k_keylistener;      private void thisworkbook_startup(object sender, system.eventargs e)     {         k_keylistener = new keyboardhooklistener(new apphooker());         k_keylistener.enabled = true;         k_keylistener.keydown += new keyeventhandler(k_keylistener_keydown);     }      void k_keylistener_keydown(object sender, keyeventargs e)     {         if (control.modifierkeys == keys.control)             if (e.keycode == keys.v)             {                 worksheet actsht = activesheet worksheet;                 range rng = actsht.application.selection range;                 if (messagebox.show("you paste values only. want continue?", "paste confirmation", messageboxbuttons.yesno, messageboxicon.question) == dialogresult.yes)                 {                     rng.pastespecial(xlpastetype.xlpastevalues, xlpastespecialoperation.xlpastespecialoperationnone, false, false);                 }                 e.handled = true;             }     } 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -