472,143 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

controlling Ms Powerpoint Slide show using Vb.net

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
1 13620
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.

Similar topics

9 posts views Thread by Michael Burtenshaw | last post: by
reply views Thread by ProfessorKaos | last post: by
1 post views Thread by bsg92150 | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.