Solved

To close powerpoint window through vb.net

Posted on 2010-11-19
6
1,583 Views
Last Modified: 2013-12-16
I am not getting how to close powerpoint window  or application through vb.net

code sample for the same is,

  Dim oPP As Microsoft.Office.Interop.PowerPoint.ApplicationClass
                            Dim oPresSet As Microsoft.Office.Interop.PowerPoint.Presentations
                            Dim oPres As Microsoft.Office.Interop.PowerPoint.PresentationClass


                            Try
                                oPP = GetObject(, "PowerPoint.Application")
                            Catch ex As Exception
                                oPP = New Microsoft.Office.Interop.PowerPoint.Application
                            End Try

                            oPP.Visible = True
                            oPresSet = oPP.Presentations
                            oPres = oPresSet.Open((SrceFileName), , , True)
                            oPP.ActivePresentation.SaveAs(_destname, 1, )
                            oPP.ActivePresentation.Close()
                            oPP.Quit()

but it does not get closed.....
0
Comment
Question by:gopalhazel
  • 3
  • 2
6 Comments
 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 34171525
Have you tried releasing the object:

Chris
Dim oPP As Microsoft.Office.Interop.PowerPoint.ApplicationClass
                            Dim oPresSet As Microsoft.Office.Interop.PowerPoint.Presentations
                            Dim oPres As Microsoft.Office.Interop.PowerPoint.PresentationClass


                            Try
                                oPP = GetObject(, "PowerPoint.Application")
                            Catch ex As Exception
                                oPP = New Microsoft.Office.Interop.PowerPoint.Application
                            End Try

                            oPP.Visible = True
                            oPresSet = oPP.Presentations
                            oPres = oPresSet.Open((SrceFileName), , , True)
                            oPP.ActivePresentation.SaveAs(_destname, 1, )
                            oPP.ActivePresentation.Close()
                            oPP.Quit()
system.runtime.interopservices.marshal.releasecomobject (opp)
opp = nothing

Open in new window

0
 
LVL 59

Accepted Solution

by:
Chris Bottomley earned 500 total points
ID: 34171540
A quick look see suggests for example the following example:

http://support.microsoft.com/kb/306682

Chris
0
 

Author Comment

by:gopalhazel
ID: 34172161
Hi Chris,

I tried that but it didn't work. It closes all the active presentations but powerpoint remains open in minimized state.
in word, i have done as

 newword_.Documents.Application.ActiveWindow.View.FullScreen = False
                newword_.Quit()

it closes winword from taskbar. similarly what we can do for powerpoint??
0
Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

 
LVL 59

Expert Comment

by:Chris Bottomley
ID: 34172411
Honestly can't help then ... I expected release object on the app and presentation would have done it.

Chris
0
 
LVL 23

Expert Comment

by:JSRWilson
ID: 34173808
oPP.Quit I would have thought would work too.

Is this 2010 or an earlier version
0
 

Author Comment

by:gopalhazel
ID: 34179238
this is for Ms2003 and MS2007
0

Featured Post

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Great sound, comfort and fit, excellent build quality, versatility, compatibility. These are just some of the many reasons for choosing a headset from Sennheiser.
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question