views:

21

answers:

1

I'm trying to determine how to black/unblack a Powerpoint presentation using VBA. I modified a VBA Macro that I found online (http://my.safaribooksonline.com/9780470634004/670?bookview=search -- "Mastering VBA for Microsoft Office 2010; page 670")

Sub Test1()
    With ActivePresentation.SlideShowWindow.View
        .State = ppSlideShowBlackScreen
        .State = ppSlideShowRunning
    End With
End Sub

Setting the state to ppSlideShowBlackScreen does indeed make the screen go black. According to the book, "To toggle the black screen or white screen off and start the show running again, set the State property to ppSlideShowRunning".

If I run this in PPT 2007, it works as expected - it almost looks like nothing happened (I imagine the screen goes black for a fraction of a second & then returns to normal). Commenting out the second line does show a black screen, which shows that this is working as expected.

However, if I run this macro in PPT 2010 the screen goes black & stays black. No matter what I set the state to, I can't make the screen revert to its original state.

  • I tried ppSlideShowWhiteScreen & it shows a completely white screen, but that's it.
  • I tried ppSlideShowPaused as well, but it didn't do anything

If I use the "Black" screen option from the PPT menu, the screen goes black & the option changes to "Unblack" screen. Using this does revert the screen back to normal. Also, using the keyboard shortcut ("b") will toggle between black & normal mode.

So, there must be a way to do this in PPT 2010, but for some reason the VBA method isn't working correctly. Any ideas?

A: 

I think Otaku is right - it's just a bug in PPT. I haven't heard anything on the MSDN forums about this either, so I'm willing to accept that. Thanks to everyone who had a look at the question.

Shawn