By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,364 Members | 1,267 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,364 IT Pros & Developers. It's quick & easy.

controlling Ms Powerpoint Slide show using Vb.net

P: 2
hi all,

i want to run the slide show say ten slides and then close it , but in my code given below it opens the slide show and closes immediately ... ..
please give me a solution to this problem

1. Please add MsPowerpoint11.0 object present in COM in ur references.

2. Code : --
Expand|Select|Wrap|Line Numbers
  1. Dim appPowerpoint as Powerpoint.Application 
  2. dim book as Powerpoint.presentation 
  3. dim slide as powerpoint.slides 
  4. dim picture as powerpoint.sliderenge 
  5. dim path as string ' location of the file  
  6.  
  7. appPowerpoint = new Powerpoint.Application
  8. appPowerpoint.Active( )
  9. appPowerpoint.NewPresentation.add(1,,) 
  10.  
  11.  path  = "d:\x.ppt"
  12.  
  13. appPowerpoint.presentation.open(path,commes automatically(select the first choice),commes automatically(select the first choice))
  14.  
  15. appPowerpoint.activePresentation.slideshow.run() 
  16.  
  17. '........
  18. ....... some code is   needed so that i  run the slide show say 10 slides and then  close it 
  19. .......
  20.  
  21. but 
  22. 'it quits immediately ........  
  23.  
  24. appPowerpoint.activePresentation.close
  25. appPowerpoint.windows.application.quit
please reply back as soon as possible...


with thanks,
mumbaisalsa
Nov 17 '07 #1
Share this Question
Share on Google+
1 Reply


P: 2
i got the solution to the problem ... .
appPowerpoint.ActivePresentation.SlideShowSettings .Run.View.GotoSlide(i, Microsoft.Office.Core.MsoTriState.msoCTrue = Microsoft.Office.Core.MsoTriState.msoCTrue)

added the above code and it works .......
thanks
mumbaisalsa

i want to run the slide show say ten slides and then close it , but in my code given below it opens the slide show and closes immediately ... ..
please give me a solution to this problem

1. Please add MsPowerpoint11.0 object present in COM in ur references.

2. Code : --
Expand|Select|Wrap|Line Numbers
  1. Dim appPowerpoint as Powerpoint.Application 
  2. dim book as Powerpoint.presentation 
  3. dim slide as powerpoint.slides 
  4. dim picture as powerpoint.sliderenge 
  5. dim path as string ' location of the file  
  6.  
  7. appPowerpoint = new Powerpoint.Application
  8. appPowerpoint.Active( )
  9. appPowerpoint.NewPresentation.add(1,,) 
  10.  
  11.  path  = "d:\x.ppt"
  12.  
  13. appPowerpoint.presentation.open(path,commes automatically(select the first choice),commes automatically(select the first choice))
  14.  
  15. appPowerpoint.activePresentation.slideshow.run() 
  16.  
  17. '........
  18. ....... some code is   needed so that i  run the slide show say 10 slides and then  close it 
  19. .......
  20.  
  21. but 
  22. 'it quits immediately ........  
  23.  
  24. appPowerpoint.activePresentation.close
  25. appPowerpoint.windows.application.quit
please reply back as soon as possible...


with thanks,
mumbaisalsa
Nov 20 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.