Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving files on the desktop
Message
 
À
07/05/2008 03:10:49
Jill Derickson
Software Specialties
Saipan, CNMI
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01315523
Message ID:
01315525
Vues:
19
>Hi,
>
>I have a pretty un-computer literate client (a lawyer), and the system i wrote for him generates a Word Document that he wants to access easily. He is suggesting that I save the file on his desktop (he will be doing this rarely).
>
>Is there a way i can save a file to the desktop in VFP?
>
>Thanks, Jill

Check Message #1251814 to see how to get Desktop path, then just save the file there:
#define CSIDL_DESKTOP 16
lcPath = SPACE(500)
DECLARE INTEGER SHGetFolderPath IN SHFOLDER.DLL ;
   INTEGER hwndOwner, ;
   INTEGER nFolder, ;
   INTEGER hToken, ;
   INTEGER dwFlags, ;
   STRING @ pszPath
IF SHGetFolderPath(0, CSIDL_DESKTOP, 0, 0, @lcPath) == 0
   lcPath = ADDBS(ALLTRIM(lcPath,1,CHR(0),CHR(32)))
ENDIF
.....
LOCAL oWord AS Word.Application
oWord = CREATEOBJECT([Word.Application])
oWord.Documents.Add()
oWord.ActiveDocument.SaveAs(lcPath+[NameOfDoc])
Not tested very well and no error handling included.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform