pojuse strict; use warnings; use Win32::OLE; use Win32::OLE::Const 'Microsoft Word'; my $My_Word = Win32::OLE->new('Word.Application') or die "Problem with MS-WORD"; my $counter = 4534; my $path = 'C:/temp/'; while(<DATA>) { chomp $_; $counter++; my $docx_name = $path.$counter.".docx"; $My_Word->Documents->Add || die("Unable to create document ", Win32: +:OLE->LastError()); $My_Word->{'Visible'} = 0; $My_Word->{DisplayAlerts} = 0; $My_Word->Selection->TypeText ({ Text => $_ }); $My_Word->ActiveDocument->SaveAs( $docx_name ); $My_Word->{ActiveDocument}->Close; print "Created $docx_name\n"; } $My_Word->Quit; __DATA__ First Document Second Document Third Document
In reply to Re: create .docx files (MS-WORD with WIN32::OLE)
by poj
in thread create .docx files (MS-WORD with WIN32::OLE)
by gadi99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |