- #!/usr/bin/perl
- use warnings;
- use strict;
- use Win32::OLE;
- chomp( my $line = <STDIN> );
- my $word = new Win32::OLE( "Word.Application" )
- or die( "Error opening a document in Word: $!" );
- $word->{ Visible } = 1;
- $word->Documents->Add();
- $word->Selection->Font->{ Size } = 100;
- $word->Selection->Font->{ SmallCaps } = 1;
- $word->Selection->Font->{ Animation } = 3; # sparkle text
- $word->Selection->TypeText( $line );
- #该片段来自于http://www.codesnippet.cn/detail/23112012621.html
来源: http://www.codesnippet.cn/detail/23112012621.html