Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Vfp6.0 Report Writer to Word document - FRX2Word
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00397237
Message ID:
00397348
Views:
13
>Hi All,
>
>I was able to download FRX2WORD, but I must admit that I don't understand how to make it work in my form.
>
>Currently my form has a textbox in which the user can enter a four digit code indicating for which consignor they want to create a statement. After entering the code (i.e., "PREF"), the focus goes to a command button which has this code in the click event:
>
>***begin code
>store ThisForm.Sttxtcons.value to mcon
>repo form strpconsignorstatement for stncwork.cons_no = ThisForm.Sttxtcons.value ;
>to file &mcon ascii
>oword = createobject("Word.application")
>OWORD.VISIBLE = .T.
>mcurdir = FULLPATH("&MCON")
>myDocument = mcurdir + ".TXT"
>oword.documents.open(mydocument)
>InMargin = oword.InchesToPoints(0.5)
>OWORD.activedocument.pagesetup.TopMargin = InMargin
>OWORD.activedocument.pagesetup.BottomMargin = InMargin
>OWORD.Selection.WholeStory
>OWORD.selection.Font.Name = "Courier New"
>OWORD.selection.Font.Size = 10
>ThisForm.Sttxtcons.value = " "
>ThisForm.Sttxtcons.SETFOCUS()
>thisform.refresh
>***end code
>
>This creates the basic "statement", which can then be edited, if necessary. This is okay but not perfect.
>
>I've read that FRX2WORD will take the .frx and create a "Word" doc with the formatting such as fonts, bold, etc.
>

Forget all the Word stuff. Create your FRX using Report Writer. Include the VCX from FRX2Word in your project. To print MyReport.FRX through Word, do the following, as cut straight from the Help File:
oF2W = NEWOBJECT("frx2word", "msoexp") && Create instance of FRX2WORD
oF2W.SaveFolder = "C:\My Documents\"        && directory to create .DOC in
oF2W.DOC_FileName = "Wordout.doc"           && name of .DOC file to create
nSuccess = oF2W.ReportForm("MyReport")      && Process MyReport.FRX to create document
>Please excuse this most basic of questions, but after reading the documentation I'm still not sure what I need to do.
>
>I've used the "form designer" to add the control to the form but I don't know how to make it function.
>
>Any help would be appreciated.
>
>TIA,
>
>Jim Harvey
>jharvey@netrax.net
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform