Word VBA controlling PowerPoint

B

Bits-n-PCES

I build Powerpoint presentations from Word using VBA automation. In Office
2007, Powerpoint randomly crashes when I change activewindow.viewtype from
normal to notes page view. I do this repeatedly throughout the slide
generation process because I am writing presenter notes as well as slide
content. It works well (and fast) in Office 2003 but crashes in 2007 after
building a handful of slides (it even calls the same code to switch views
many times before it does!) After about 8-10 slides I get the Recover your
work/Send this to Microsoft/ Quit screen. I set the view by referring to the
powerpoint document's application like so:
myDoc.Application.ActiveWindow.ViewType = ppViewNotesPage. Are there any
known bugs reported regarding switching views? Is there a better way to do
it? Also, unrelated but... If it does finish building the presentation as it
sometimes will, when I call the save and close fucntions for the PowerPoint
document and then try using the quit() function on the application,
PowerPoint does not quit. And always it will crash the next time, unless I
end the process in task manager.

Help!
 
B

Bill Dilworth

You may want to try adding some sleep commands to allow the program to
"catch up" with your code. You are using live views in your code. If the
views can't keep up, you may be trying to process from a window that is not
fully open yet.

See: http://www.pptfaq.com/FAQ00466.htm


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top