file io - Minimization of open word documents -


i using code , minimize open word documents.

word.application wordapp = new word.application(); word.documents docs = wordapp.documents;  wordapp.screenupdating = true; wordapp.windowstate = word.wdwindowstate.wdwindowstateminimize; 

but documents list empty despite fact have open word 2010 documents in windows 7. minimization not working.

how can , minimize open word documents?

new word.application() create new instance of word.

to connect existing instance, can use

word.application wordapp = (word.application)system.runtime.interopservices.marshal.getactiveobject("word.application"); 

(this similar vb/vba "getobject" function).

then should able access documents.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -