It looks to me (Just from reading your post, and looking at what little code you've provided) that you're a little confused about using this particular object model. You should post some of the things you have tried, and maybe we can help you out.
So you get an idea of the syntax, I pounded this out this morning over coffee while I caught up on week-end email.
use strict;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft PowerPoint';
$Win32::OLE::Warn = 3; # Die on Errors
my $PptApp = Win32::OLE->GetActiveObject('PowerPoint.Application')||
+Win32::OLE->new('PowerPoint.Application', 'Quit');
$PptApp->{Visible} = 1;
my $Presentation = $PptApp->Presentations->Add();
#my $Presentation = $PptApp->Presentations->Open({FileName=>'<SOMEFILE
+NAME>',ReadOnly=>1});
my $Slide = $Presentation->Slides->Add({Index=>1 , Layout=>ppLayoutTex
+t});
$Slide->{Name} = "Slide1";
my $TextBox=$Slide->Shapes->AddTextbox({Orientation=>1,
Left=>5,
Top=>5,
Width=>250,
Height=>250,});
$TextBox->TextFrame->TextRange->{Text} ="Big Ole Test";
my $Title=$Slide->Shapes->{Title};
$Title->TextFrame->TextRange->{Text} ="Title Test";
my $NewSlide = $Slide->Duplicate();
$NewSlide->{Name} = "Slide2";
I would suggest that you start PowerPoint and leave it running without any active presentations so that you can watch what is going on. Also, look again at how I call methods that require multiple inputs (Hash format vs. List format), and you need to pay close attention to what certain methods and functions return when called. C-. |