SOL9 Sample: PowerPointApplet
|
1 Screenshot
2 Source code
/*
* PowerPointApplet.cpp
* Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED.
*/
// 2010/04/09
// This is a sample program to open and close a Powerpoint file by using SOL::PowerPointApplet class.
#include <sol/office/PowerPointApplet.h>
#include <sol/office/PowerPointPresentation.h>
#include <sol/BString.h>
void _tmain(int argc, TCHAR** argv)
{
if (argc !=2) {
printf("Usage:PowerPointApplet.exe PPTFullPath\n");
return;
}
if (GetFileAttributes(argv[1]) == 0xffffffff) {
_tprintf(_T("File not found %s\n"), argv[1]);
return;
}
try {
BString docname = argv[1];
PowerPointApplet applet;
try {
PowerPointPresentation presen = applet.open((BSTR)docname, true);
printf("Opened a presentation %S\n", (BSTR)docname);
presen.close();
printf("Closed a presentation\n");
} catch (HRESULT hr) {
printf("Exception %x\n", hr);
} catch (...) {
printf("Unknown Exception\n");
}
} catch (HRESULT hr) {
printf("Exception %x\n", hr);
} catch (...) {
printf("Unknown Exception\n");
}
}
Last modified: 2 May 2016
Copyright (c) 2016 Antillia.com ALL RIGHTS RESERVED.