469,637 Members | 1,619 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,637 developers. It's quick & easy.

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 13218
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 gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.