Demonstrate how to corretly get the type of an Office document.
#ifdef WIN32
#include <crtdbg.h>
#endif
int main( int argc, const char* argv[] )
{
#ifdef WIN32
_CrtSetDbgFlag (_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
for(int i=1;i<argc;i++) {
printf("Office Document Type: %s\n", type);
if (0==xmlStrcmp(type, _X("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"))) {
printf("WORD Document\n");
} else if (0==xmlStrcmp(type, _X("application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"))) {
printf("POWERPOINT Document\n");
} else if (0==xmlStrcmp(type, _X("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"))) {
printf("EXCEL Document\n");
}
}
}
}
#ifdef WIN32
#endif
return 0;
}