ms office - How to get All Microsoftword files using C# -
i've opened 4,5 different files , want detail of each file. detail means file name, fullpath etc.
objword = (microsoft.office.interop.word.application)system.runtime.interopservices.marshal.getactiveobject("word.application"); (int = 0; < objword.windows.count; i++) { label.content = objword.activedocument.fullname.tostring() + environment.newline; }
using above lines i'm able detail of current active file detail. how can detail of other files not active.
you're accessing same activedocument
on each iteration of loop (and overwriting value every time). try changing line in for
loop to:
label.content += objword.windows(i).document.fullname.tostring() + environment.newline;
Comments
Post a Comment