ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Comment créer un page HTML avec Windows Scripting   



L'auteur

Mike Gagnon
Canada Canada
Membre Simple
# 0000000025
enregistré le 14/10/2004

Gagnon Mike
Pointe Cla H9R 3K8
de la société Carver Technologies Inc.
Fiche personnelle


Note des membres
17/20
1 vote


Contributions > 09 - Automation > Windows Scripting

Comment créer un page HTML avec Windows Scripting
# 0000000112
ajouté le 01/12/2004 22:59:37 et modifié le 01/12/2004
consulté 7176 fois
Niveau initié

Version(s) Foxpro :
VFP 7.0

Code source :
Local strFileName, objFSO, objMenuPage
objFSO = Createobject("Scripting.FileSystemObject")
Set Default To Home(2)+"\tastrade\data\"
strFileName = "c:\MyFile2.htm"
objMenuPage = objFSO.createtextFile(strFileName, 2, .T.)
objMenuPage.WriteLine( "<HTML><head><title>Test Creating file</title></title></head>")
SELECT Customer.company_name, Customer.address, Customer.city,;
  Customer.region, Customer.postal_code, Customer.country;
 FROM tastrade!customer;
 ORDER BY Customer.company_name;
 INTO CURSOR Query1
objMenuPage.WriteLine( "<tr>")
objMenuPage.WriteLine( "<HTML><BODY><TABLE>")
Scan
    objMenuPage.WriteLine( "<tr>")
    For lnField = 1 To Afields(laFields)
        objMenuPage.WriteLine( "<td>")
        objMenuPage.WriteLine(Evaluate(Field(m.lnField)))
        objMenuPage.WriteLine( "<td>")
    ENDFOR
    objMenuPage.WriteLine( "</tr>")
ENDSCAN
objMenuPage.WriteLine( "</table></body></html>")
loExcel  = CREATEOBJECT("excel.application"&& Optional
loExcel.workbooks.open("c:\myFile2.htm"&& Optional
loExcel.visible = .t.

Commentaires
Aucun commentaire enregistré ...

Publicité

Les pubs en cours :


www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2024.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3