It can't get an exclusive lock on that DOC file name -or- it's an invalid file name. That's what the code means. Experiment with different Word doc filenames or see if that particular file name already exists and is in use elsewhere or see if you have creating rights on the directory where it's gonna be stored.
Another possibility is spaces in the Doc file name.
>hello I get -91 return code on frx2word:
>
>This is the code I use:
>
>Report FORM invoice_c5 PREV && This works
>
>
>&& This does not work.
>
>oF2W=NEWOBJECT("frx2word","K1Class")
>oF2W.SaveFolder="c:\motifw\Documents\"
>oF2W.DOC_FileName=ALLTRIM(lcInvno)+"_InvoiceWord.doc"
>nSuccess=oF2W.ReportForm("invoice_c5")
>Messagebox(oF2W.DOC_FileName+"! Created", 48, "Export to Word")
>wait str(nSuccess) window
>
>Any hints? Thank you - Roger
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05