mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
22 lines
731 B
TypeScript
22 lines
731 B
TypeScript
// tslint:disable-next-line no-unnecessary-generics
|
|
const collectionToArray = <T>(col: any): T[] => {
|
|
const results: T[] = [];
|
|
const enumerator = new Enumerator<T>(col);
|
|
enumerator.moveFirst();
|
|
while (!enumerator.atEnd()) {
|
|
results.push(enumerator.item());
|
|
}
|
|
return results;
|
|
};
|
|
|
|
const app = new ActiveXObject('Word.Application');
|
|
const projects = collectionToArray<VBIDE.VBProject>(app.VBE.VBProjects);
|
|
projects.forEach(project => {
|
|
WScript.Echo(`Name: ${project.Name}`);
|
|
|
|
collectionToArray<VBIDE.Reference>(project.References)
|
|
.forEach(reference => {
|
|
WScript.Echo(` ${reference.Name} ${reference.Major}.${reference.Minor} -- ${reference.FullPath}`);
|
|
});
|
|
});
|