c# - Can I deselect something in MS Word that had earlier been selected in the program -


i have piece of code part of event handling selecting image in word document , copying in file. after event handler done, image shown selected when return word after event has been handled. code snippet follows :

foreach (word.inlineshape shape in shapes) {     string filepath = "somepath";     shape.select();     word.application application = globals.thisaddin.application;     application.selection.copyaspicture();     computer comp = new computer();     image image = comp.clipboard.getimage();     image.save(filepath, system.drawing.imaging.imageformat.jpeg);     comp.clipboard.clear(); } 

i want shape should not shown selected because shape selection part of event handling.

is there way deselect shape.

thanx suggestions.

you deselect current selection using

application.selection.collapse() 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -