tewelch has asked for the wisdom of the Perl Monks concerning the following question:

While bulding PowerPoint slides I'm making use of the Height attribute of the TextBoxes on the slide to determine when it's time to start a new slide.
$TextBox = ${'Slide_'.$slideNumber}->Shapes->AddTextbox({Orientati +on=>1,Left=>80,Top=>$bulletYPos,Width=>600,Height=>20,}); $TextBox->TextFrame->TextRange->{Text} = 'blah blah blah'; $TextBoxHeight = $TextBox->Height;
This works great until I start a second slide. It seems that PowerPoint needs to be told what the active slide is in order to get the correct value returned from Height. My question is how do I tell PowerPoint to activeate the latest created slide. When the presentation is being built I can watch the slides being created in PowerPoint but even as additional slides are being added, PowerPoint continues to display slide 1 until I do a page down or make a selection from the slide sorter. I recorded a macro to see what happens when a different slide is selected but the macro was blank. I tried some other things like
${'Slide_'.$slideNumber}->ActivateWindow();
and
${'Slide_'.$slideNumber}->ActiveWindow();
but neither worked. Thanks.

Replies are listed 'Best First'.
Re: win32::ole ActiveWindow
by jdporter (Paladin) on Dec 03, 2003 at 18:47 UTC
    I think the method you want is Select().

    However, I'm not sure you're doing this the optimal way. If you call Slide_2->Select(); when only one slide exists, what happens? Does it create the second slide automatically, then select it?
    I'd be inclined to do something like
    $new_slide = $presentation->Slides->Add( $slideNumber, ppLayoutBla +nk ); $new_slide->Select;

    jdporter
    The 6th Rule of Perl Club is -- There is no Rule #6.

      After reviewing the object model in MSDN I figured out something that works. Each time I start a new slide I use the following to make the new slide Active:
      $ActiveWindow = $PptApp->ActiveWindow; $ActiveWindow->Activate(); $ActiveWindow->View->GotoSlide({Index=>$slideNumber});
Re: win32::ole ActiveWindow
by Zero_Flop (Pilgrim) on Dec 03, 2003 at 18:14 UTC
    Gotts to be quick before work.

    Check out ppVeiwSlide in the VB screen.

    Lidrary -> Power Point
    Class -> PPviewType