Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I open pdf or txt file? Any gotcha?
Message
De
02/02/2004 15:03:21
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00873080
Message ID:
00873110
Vues:
18
Hi Nick

Veeery simple:

1. Drop class _shellexexute on your form _SHELLEXECUTE1
2. Add a 'Open file' button cmdOpenFile
3. Add something like this code to the click event of cmdOpenFile:
this.Parent._SHELLEXECUTE1.shellexecute(TRIM(ADDBS(SYS(5)+SYS(2003))+TRIM(lcFilename))

That's all!

>I am trying to open different types of files when my user doubleclicks in a tree. So far I have tried to make word and excel open but I don't know how I would go about opening a text and pdf file. Here is the code I have so far.
>
>
>CASE UPPER(RIGHT(.ctTree1.Path(.ctTree1.selected),4)) = ".XLS"
>        oleApp = CREATEOBJECT("Excel.Application")
>        OleApp.Visible=.T.
>        OleApp.Workbooks.Open(thisform.dirloc1.gv_docpath+"\"+.cttree1.path(.ctTree1.selected))
>
>CASE UPPER(RIGHT(.ctTree1.Path(.ctTree1.selected),4)) = ".DOC"
>        oleApp = CREATEOBJECT("Word.Application")
>        OleApp.Visible=.T.
>        OleApp.Documents.Open(thisform.dirloc1.gv_docpath+"\"+.cttree1.path(.ctTree1.selected))
>
>
>how do I open a pdf or text file? Also is there a cleanup process I should know about? Are there any "gotcha" or downside using this method I should code for?
>
>thanks
>Nick Patel
>
>thanks
>Nick Patel
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform