in reply to "type mismatch" in Word

Perhaps you can't use named parameters like that. I looked up the positional arguments for .SaveAs and the first two are FileName and FileFormat. Try that again as $mydoc->SaveAs( $xfn, 'wdFormatDocument' ).