Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opening other applications
Message
 
À
06/12/2004 18:50:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 6
Database:
Visual FoxPro
Divers
Thread ID:
00967323
Message ID:
00967406
Vues:
13
Unfortunately you 3 limitations to be able to attach a file to an e-mail. mailto: is one and ShellExecute does not have enough parameters to permit attching a file, and lastly Outlook Express is not a COM server as Outlook is, so you also have a limited access to it. There are many ways to send an E-mail message with attached, but as far as I know ShellExcecute is not one of them. Here is an example that works (but as the ShellExcetute sample you have, it will only bring up a new e-mail message with an attachement, ready to finish filling out and sending). This will work with Outlook Express (Or Outlook) depending which one is set as default e-mail program. This will only work properly is the attchment has a valid name et a valid path. (This example is based on an example of Anatoliy Mogylevets code to be found on news2news.com)
DECLARE INTEGER GetActiveWindow IN user32
DECLARE INTEGER MAPISendDocuments IN mapi32 INTEGER ulUIParam, STRING lpszDelimChar,;
		STRING lpszFullPaths, STRING lpszFileNames,;
		INTEGER ulReserved

LOCAL lcPath, hWindow, lcDelimiter, lcFiles, lcMsgSubj
lcDelimiter = ";"
lcFiles = "C:\test.prg"
lcMsgSubj = "Files attached: c:\test.prg" 
= MAPISendDocuments (hWindow, lcDelimiter, lcFiles, lcMsgSubj, 0)
>Hi Mike
>Your code helped me out in printing a file, thanks. Using your code below, how can I attach a file, is it possible ??
>
>>* Open the default mail reader to address a letter to the VFP wish list
>>=Shellexecute(0,"Open","mailto:foxwish@microsoft.com?subject=A VFP Wish","","",0)
>Your help will be appreciated.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform