Dim slide As slide Dim shape As shape For Each slide In ActivePresentation.Slides For Each shape In slide.Shapes If shape.TextFrame.HasText Then If shape.HasTextFrame Then shape.TextFrame.TextRange.Text = Replace(shape.TextFrame.TextRange.Text, "PM3", "TCF6203") End If End If Next shape Next slide End Sub #### use strict; use warnings; use Cwd; use Win32::OLE; use Win32::PowerPoint; use Win32::OLE::Const 'Microsoft Office'; use Win32::OLE::Const 'Microsoft PowerPoint'; use Win32::Process; use Win32::OLE::Enum; $Win32::OLE::Warn = 3; my $file = "PM30306901A SMP Limit Switch.pptx"; my $dir = getcwd(); my $filename = $dir . '\\' . $file; print ("Starting PowerPoint\n"); my $process = Win32::OLE->GetActiveObject('Powerpoint.Application')|| Win32::OLE->new('Powerpoint.Application', 'Quit'); print ( "Opening '$filename'\n" ); my $ppt = $process->Presentations->Open($filename); my $pp = Win32::PowerPoint->new; $file =~ s/PM3/TCF6203/; $filename = "$dir/$file'"; print ( "Replacing 'PM3' with 'TCF6203'\n" ); my @activeslides = $process->ActivePresentation->Slides; foreach my $slide (@activeslides) { foreach my $shape ($slide->Shapes){ if ($shape->TextFrame->HasText){ if ($shape->HasTextFrame){ $shape->TextFrame->TextRange->Text = Replace($shape->TextFrame->TextRange->Text, "PM3", "TCF6203"); } } } } print ( "Saving '$filename'\n" ); $pp->save_presentation($filename);