Help for this page

Select Code to Download


  1. or download this
    my $word = Win32::OLE->GetActiveObject('Word.Application')
        || Win32::OLE->new('Word.Application','Quit')
        or die Win32::OLE->LastError();
    
  2. or download this
    my $doc = $word->Documents->Open('C:\\Perl\\home\\001f.doc');
    
  3. or download this
    my $doc = $word->Documents->Open( { FileName => 'C:\\Perl\\home\\001f.
    +doc', ReadOnly =>1 }) or die Win32::OLE->LastError();
    SaveAs({FileName => 'exampletext.doc', FileFormat =>  wdFormatDocument
    +,})
    $doc->Close( { SaveChanges => $wdc->{wdDoNotSaveChanges} } );
    
  4. or download this
    Class Selection
        Member of Word
    ...
    Property Characters As Characters
        read-only
        Member of Word.Selection
    
  5. or download this
    #!/usr/bin/perl
    use Cwd 'abs_path';
    ...
    Words:1
    Characters:1
    Paragraphs: 1
    
  6. or download this
    #!/usr/bin/perl -w
    
    ...
    $Word->ActiveDocument->Close ;
    $Word->exit;
    $Word->Quit;