excel - In vsto C#, when copying(no pasting) a range, how to know this range(row/col/rect info)? -


example in excel 2013, select range a1:c3 , ctrl-c or right click copy. noticing there animation moving arounding range, meaning copied it.

now want range in code.

i hooked copy invent in windows message. , how can range? pls help.

example code:

private override oncopy(excel.range source){     //...     base.oncopy(source);       //now can source range when copy happens.     //but in vsto, there no such method.     //help me work around } 

you can use selection object current selection. may return selection, not copied.

to copied seletion object need set keyboard hook intercepting ctrl+c keyboard buttons and/or repurspose ribbon controls.

see using shortcut keys call function in office add-in started windows hooks.

most repurposing ribbon controls enough (context menus use ribbon ui). see temporarily repurpose commands on office fluent ribbon more information.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -