SOL9 Sample: ExcelPublisher
|
1 Screenshot
2 Source code
/*
* ExcelPublisher.cpp
* Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED.
*/
//2010/05/12
// This is a sample program to publish a WordDoc file as a file of format of 'html', 'mhtml', 'txt', 'XPS' or 'PDF'.
//2012/05/11 Modified to use SOL::ExcelPublisher class.
#include <sol/office/ExcelPublisher.h>
#include <sol/Locale.h>
void _tmain(int argc, TCHAR** argv)
{
if (! (argc == 3 || argc ==4)) {
printf("Usage: ExcelPublisher.exe docPathName html|mhtml|txt|csv.\n");
printf("or: ExcelPublisher.exe docPathName savePathName html|mhtml|txt|csv.\n");
printf("Note: docPathName or savePathName can take a full or relative path.\n");
return;
}
Locale locale;
try {
const TCHAR* docPathName = argv[1];
const TCHAR* saveFormat = NULL;
ExcelPublisher publisher;
if (argc == 3) {
saveFormat = argv[2];
publisher.publish(docPathName, saveFormat);
}
if (argc == 4) {
const TCHAR* savePathName = argv[2];
saveFormat = argv[3];
publisher.publish(docPathName, savePathName, saveFormat);
}
} catch (HRESULT hr) {
printf("Exception %x\n", hr);
} catch (Exception& ex) {
ex.printf();
} catch (...) {
printf("Unknown Exception \n");
}
}
Last modified: 2 May 2016
Copyright (c) 2016 Antillia.com ALL RIGHTS RESERVED.