Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FRX to word, Why this doesn't work, no word file is create

Status
Not open for further replies.

Gert

Programmer
Apr 9, 2000
240
DO
Hi all,
I need to create a word file from a report, but no word doc. is create on the disk, this is my code.

SELE mprior, mid_de_supe,mn_regi, mdatei,mevent
mtimesol,maccion, mdatecre;
FROM tblbop into cursor myreport;
WHERE mdatei >=mdatei .and. mdatei<=mdatef
ORDER BY datei


LOCATE
CREATE REPORT c:\sapa\myreport2 from myreport
SET CLASSLIB TO c:\sapa\msoexp.vcx
oRep = CREATEOBJECT("frx2word")
orep.html_filename="myDoc.htm"
oRep.doc_filename="myDoc.doc"
orep.reportform("c:\myReport2.frx")

myFile="mydoc.doc"
DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, STRING cAction, STRING cFileName, ;
STRING cParams, STRING cDir, INTEGER nShowWin
=ShellExecute(0,"open",myfile,"","",1)
 
Gert,

I may be way off here, I'm using "frx2any" (do google search) from a free trial version, that works fair to midland.

Everything else out there truly has failed for me. I'm assuming your frx2word object even exists, etc. Does it exist, etc.?

Phil

Philip M. Traynor, DPM
 
If the word file opens and it looks like an empty document - change the view in Word to to Web Layout(View->Web Layout)and then see if you can see the document.

 
Here is my working FRX2Word VFP7 code:


SELECT RptFile
GO TOP
=WriteDOC(mcFRXName, mcDOCName)
<And Whatever>


* ------------------------------------
* Write FRX Report and Convert It
* Into A MS Word DOC file
*
FUNCTION WriteDOC
PARAMETERS mcFRXFile, mcDOCFile

oF2W = NEWOBJECT("frx2word","msoexp")
oF2W.SaveFolder = mcFileDir + "\"
oF2W.DOC_FileName = mcDOCFile
oF2W.ReportHome = mcOtherPrgDir
nSuccess = oF2W.ReportForm(mcFRXFile)

RELEASE oF2W
RETURN .T.


=========================================
msoexp.vcx is already Registered as part of the installation process on my user's PC's.

My Report FRX's are already created.

Note - I have had some situations where the DOC file was created fine, but it was saved with an odd View Layout. On opening the document manually in Word, it would appear blank, but when I changed the View to Page Layout, everything appeared as intended.

I fixed it by changing the NORMAL.DOT file of my users so that it ensured that the DOC file was created with a Page Layout and not something else.

Good Luck,
JRB-Bldr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top