Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / August 2006

Tip: Looking for answers? Try searching our database.

override the saveas function in powerpoint

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
neoret - 01 Aug 2006 13:28 GMT
Hei.

I'm programming an addin using c#. My applications overrides the users
actions to save a presentation. I add some information and needs to save the
presentation myself. In word and excel there is a method called
document/workbook saveas.

I cant get the method for saving a presentation to work...

theActivePpt.SaveAs(filename,                    
Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType.ppSaveAsPresentation,
                   Microsoft.Office.Core.MsoTriState.msoTriStateMixed);

I have tried serveral versions of the variables above.

I really hope someone knows how this can be solved :)
Steve Rindsberg - 01 Aug 2006 16:02 GMT
> Hei.
>
[quoted text clipped - 12 lines]
>
> I really hope someone knows how this can be solved :)

First we need to know what "this" is.  You say you can't get it to work but
what does that mean?  You get error messages?  Crashes?  Smoke out of the back
of the computer?  :-)

But for starters, have you just tried theActivePpt.Save

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
neoret - 01 Aug 2006 20:07 GMT
I get an exception when the saveAs method written earlier is called:
- the exception is a system.runtime.interopServices.COMException
- the error code is: -2147467259
- the message is Presentation(unknown member): Failed.

I tried your suggestion (theActivePpt.Save) - then I got an exception as
well :(

Neoret

> > Hei.
> >
[quoted text clipped - 24 lines]
> PPTools:  www.pptools.com
> ================================================
Steve Rindsberg - 01 Aug 2006 21:32 GMT
> I get an exception when the saveAs method written earlier is called:
> - the exception is a system.runtime.interopServices.COMException
[quoted text clipped - 3 lines]
> I tried your suggestion (theActivePpt.Save) - then I got an exception as
> well :(

FWIW, this in VBA works fine:

Sub TestSave()
   ActivePresentation.SaveAs ("q:\support\junk.ppt")
End Sub

and would work equally well as:

oPresentationObject.SaveAs ....

Could it be that theActivePpt holds a reference to something other than a
Presentation object?  

> Neoret
>
[quoted text clipped - 26 lines]
> > PPTools:  www.pptools.com
> > ================================================

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
neoret - 02 Aug 2006 12:04 GMT
Thanks for helping me getting closer to success!

Could this have anything to do with late bounding?

I found out in debugging that when I run this method from word the
applicationobject = Microsoft.office.interop.word.applicationClass.

When I run it in powerpoint the applicationobject = System_Comobject...

This is probably the problem - but do you know why this happens?

> > I get an exception when the saveAs method written earlier is called:
> > - the exception is a system.runtime.interopServices.COMException
[quoted text clipped - 53 lines]
> PPTools:  www.pptools.com
> ================================================
Steve Rindsberg - 02 Aug 2006 17:13 GMT
> Thanks for helping me getting closer to success!
>
> Could this have anything to do with late bounding?

It could, I suspect.  Since I don't use C# or .Net I can't easily interpret the results
you're seeing, but if you were doing the same thing in VB/VBA you'd need to declare the
presentation object as a generic object rather than as a presentation.

> I found out in debugging that when I run this method from word the
> applicationobject = Microsoft.office.interop.word.applicationClass.
[quoted text clipped - 60 lines]
> > PPTools:  www.pptools.com
> > ================================================

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.