If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
open Powerpoint main window and display a PPT file with automation
Hi,
I am now using C++ and Powerpoint automation interface to create a powerpoint file and save it. That works fine. Now, I want open that document with Powerpoint when the file is successfully created. I am coding like the following: ------------------------------------------------------------------------ // Get DISPID for the Open method on the Presentations collection object szFunction = OLESTR("Open"); hr = pDispPrsCol-GetIDsOfNames(IID_NULL, &szFunction, 1, LOCALE_USER_DEFAULT, &dispid_PrsColOpen); VARIANT vArgsOpen[1]; DISPPARAMS dpOpen; vArgsOpen[0].vt = VT_BSTR; vArgsOpen[0].bstrVal = bstrTemp; dpOpen.cArgs = 1; dpOpen.cNamedArgs = 0; dpOpen.rgvarg = vArgsOpen; // Open the saved Powerpoint presentation by invoking the open method hr = pDispPrsCol-Invoke(dispid_PrsColOpen, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &dpOpen, NULL, &excep, NULL); if(FAILED(hr)) OLEErrHandler(hr, excep); ::SysFreeString(bstrTemp); -------------------------------------------------------------------------- But the program gives error message: Run-time error: Presentations.Open: Invalid request. The Powerpoint frame window does not exist. So, from the error message, I guess I need to launch Powerpoint main frame window first. Can anyone let me know how to launch Powerpoint main frame window? Thanks a lot! |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Images in a database | Franz | General Discussion | 10 | October 7th, 2004 09:35 AM |
Adding staff photographs to my database | KK | New Users | 2 | September 3rd, 2004 07:41 AM |
Single Document Interface | Tyrone Blackburn | Powerpoint | 5 | September 2nd, 2004 07:17 PM |
Upload Image | Jason MacKenzie | General Discussion | 1 | September 1st, 2004 04:38 AM |
Database Window Gone | DaveB | General Discussion | 2 | July 29th, 2004 12:24 AM |