Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Print an xml file
Message
De
21/01/2016 17:49:20
 
 
À
21/01/2016 04:16:15
Metin Emre
Ozcom Bilgisayar Ltd.
Istanbul, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
01630017
Message ID:
01630053
Vues:
177
foxpro codes below:
any xml file is a simple txt file ( as prg,html,...)
notepad can open this file (as IE,FF or any navigator).

can use this vfp syntax:(see foxHelp)
TYPE FileName1 [AUTO] [WRAP] [TO PRINTER [PROMPT] | TO FILE FileName2] [NUMBER]

or simply Type getfile('xml') to printer


another light way to print directly an xml file is to print it with notepad command line (/p)
(wordpad /p does the same thing also).
local m.lcfile
m.lcfile=getfile('xml')
if empty(m.lcfile)
return .f.
endi
run/n notepad /p  &lcfile
the API shellexecute (0,"print",getfile('xml'),"","",0) dont work because there is no association
with the print verb and the xml files.
it returns a result value<=32 want to say fails.
you can invoke the commondialog print with sending keys
keyboard "{CTRL+P"}

or

creating com object "(mscomdlg.commondialog") prompt or no prompt.

you can use IE oleBrowser with
#DEFINE OLECMDID_PRINT 6
#DEFINE OLECMDID_PRINTPREVIEW 7
#DEFINE OLECMDEXECOPT_DODEFAULT 0
#DEFINE LECMDEXECOPT_DONTPROMPTUSER 2
apie=newObject("internetexplorer)
with apie
......
.Execwb(OLECMDID_PRINT  ,LECMDEXECOPT_DONTPROMPTUSER )  
.......
.quit
endwith
warning: IE have changed some old behaviors depending what IE version used.

Can also use old CMD.exe to print a file by directing it to the printer
i dont know if this yet work in dos cmd window:
type "filename.txt" >lpt1:
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform