A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Powerpoint
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

open Powerpoint main window and display a PPT file with automation



 
 
Thread Tools Display Modes
  #1  
Old December 6th, 2004, 09:57 PM
David
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 12:11 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.