Solved

Problems with PowerPoint Automation using VSTO / C#

Posted on 2009-06-29
3
1,227 Views
Last Modified: 2013-11-10
Hi,

I have problem using VSTO (I'm using C#).

I want to start and monitor a powerpoint slideshow.
I am able to start the presentation but the next-page/previous-page (Down/Up, Page-Down/Up) buttons do not work - they simply do not respond. Even rlight-click on the slide-show window (with previous/next/end-slideshow context menu) does not work.
Everything else works - specifically, "Esc" to stop the slideshow.

Pls help.


SlideShowSettings sss = currentPresentation.SlideShowSettings;
//sss.StartingSlide = 1;
//sss.EndingSlide = currentPresentation.Slides.Count;
SlideShowWindow win = sss.Run();
 
while (Application.SlideShowWindows.Count >= 1)
{
	System.Windows.Forms.Application.DoEvents();
}
 
MessageBox.Show("Show finished...");

Open in new window

0
Comment
Question by:mgaurav
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
xenacode earned 50 total points
ID: 24743498
What is the purpose of the While loop? If you want to run some code when the slide show exits you can create a handler for the Application objects SlideShowEnd event and put your code in there i.e. the Messagebox line. If you remove the While loop, the slideshow will respond.

Pete
0
 
LVL 2

Author Comment

by:mgaurav
ID: 24746490
Actually, I  got this code from MSDN... Thanks anyway... :-)
0
 
LVL 6

Expert Comment

by:xenacode
ID: 24752205
Wow! They posted that on MSDN? It's no wonder that so many developers are struggling to create good VSTO applications!
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

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

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

820 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