Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Using Win32::OLE and Excel - Tips and Tricks

by monarch (Priest)
on Jul 26, 2005 at 02:46 UTC ( [id://478057]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Win32::OLE;
    use Win32::OLE::Const 'Microsoft Office';
    use Win32::OLE::Const 'Microsoft PowerPoint';
    use strict;
    
  2. or download this
    $Win32::OLE::Warn = 3; # die on errors
    
  3. or download this
    my $filename = "c:\\temp\\testpower.ppt";
    
  4. or download this
    print( "Starting Powerpoint Object\n" );
    my $power = Win32::OLE->GetActiveObject('Powerpoint.Application') ||
        Win32::OLE->new('Powerpoint.Application', 'Quit');
    
  5. or download this
    print( "Creating a presentation\n" );
    my $ppt = $power->Presentations->Add();
    $ppt->SaveAs($filename);
    
  6. or download this
    print( "Creating a slide\n" );
    my $slide = $ppt->Slides->Add(1, ppLayoutBlank);
    $ppt->SaveAs($filename);
    
  7. or download this
    my $pname = 'C:\WINNT\Web\Wallpaper\Fall Memories.jpg';
    my $shape = $slide->Shapes->AddPicture( $pname, msoFalse, 
    ...
    $shape->ScaleHeight( 0.5, msoTrue, msoScaleFromTopLeft );
    $shape->ScaleWidth( 0.5, msoTrue, msoScaleFromTopLeft );
    $ppt->SaveAs($filename);
    
  8. or download this
    print( "Adding a 4 wide by 3 high table\n" );
    my $table = $slide->Shapes->AddTable( 3, 4, 1, 100 );
    ...
        }
    }
    $ppt->SaveAs($filename);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://478057]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-03-28 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found