use Win32::OLE qw(in with); my $Class = "Word.Application"; my $File = "c:\\temp\\MyTest.doc"; my $Word = Win32::OLE->GetActiveObject( $Class ); if( ! $Word ) { $Word = new Win32::OLE( $Class, \&Quit ) || die "Can not create a '$Class' object.\n"; } # By default a Word COM object is invisible (not # displayed on the screen). # Let's make it visible so that we can see what we # are doing… $Word->{Visible} = 1; my $Doc = $Word->Documents->Add(); $Doc->BuiltInDocumentProperties( "Title" )->{Value} = "My Win32::OLE Test"; $SavePropertiesPrompt = $Word->Options->{SavePropertiesPrompt}; $Word->Options->{SavePropertiesPrompt} = 0; $Doc->SaveAs( $File ); $Word->Options->{SavePropertiesPrompt} = $SavePropertiesPrompt; $Doc->Save(); print "Hit enter to continue...\n"; ; $Doc->Close(); sub Quit { my( $Obj ) = @_; $Obj->Quit(); }