Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
'Storing' Files in DBF files
Message
 
 
À
27/09/2011 22:40:30
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
Visual FoxPro
Divers
Thread ID:
01524682
Message ID:
01525001
Vues:
36
>>>OK, we're almost there. It works if the file exists.
>>>
>>>1. In VFP 9, it seems that I could just use the _shellexecute foundation class.
>>>2. I do I create an empty WORD (or Excel, or ....) if the file does not exist, since I get a error if I try to open it if it doesn't exist.
>>>
>>>i.e.
>>>
>>>
>>>if !file(myFile)
>>>    Run code that creates it, using the correct version of WORD (or Excel, or ....), 
>>>    based on the provided extension (DOC or DOCX, XLSX etc)
>>>endif
>>>
>>>Open myFile with shellexecute
>>>
>>
>>So, what is your question now?
>
>The user has a button on the cutomer maintenance screen that says 'Store info in a WORD file'. I then construct a file name based on the customer number and do your shell execute function. The first time the function will bomb, since the file does not exist. I want to create the file ahead of time if it does not exist. How do I do that?

I think if the file does not exists, you may want to activate the corresponding application for the user to create that file. Say, for the Excel or Word you can do it using OLE Automation. For other types you may simply start the application - search for RunExe samples.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform