I want to add $count number of images in doc file so that i need to put page break after each pic insert.#! c:\perl\bin\perl use strict; use warnings; use Win32::OLE; my $file = $ARGV[0]; my $image = $ARGV[1]; my $count = $ARGV[2]; my $class = "Word.Application"; my $word_ref = Win32::OLE->new($class) || die ("Failed to launch Word +due to", Win32::OLE::LastError()); $word_ref->{'Visible'} = 1; # Add the doc my $doc = $word_ref->Documents->Add; my ($obj_sel, $obj_shape); for (my $i=0; $i < $count; $i++) { $obj_sel = $word_ref->Selection; $obj_shape = $doc->Shapes; # add image $obj_shape->AddPicture($image); # add page break add_pagebreak($obj_sel); } # Save the file $word_ref->ActiveDocument->SaveAs($file); # destory objs undef $obj_sel; undef $obj_shape; $word_ref->Quit(); # destory contructor for word app undef $word_ref;
In reply to Re^4: how to convert this VB code to perl
by proton-69
in thread how to convert this VB code to perl
by proton-69
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |