Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Outlook automation from VFP
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Outlook automation from VFP
Divers
Thread ID:
00515629
Message ID:
00515629
Vues:
45
Hi,
I've been using the code below recently to mail customers using data from my tables. All has been well. However - I would like to use the same/similar code to send a particular file from a remote machine to my office.

Is there a simple one-line command (e.g. thismailitem.attachment = \\ccccc\ccc.dbf) that can be added to this code?

I'm aware of the VFP MAPI classes/wrappers, but - if such a thing exists - I'm
after a quick fix.

**************************

strProfile = "profile"
strPassword = "profile"
strRecipient = "anybody@domain.co.uk"
strSubject = "customer.dbf" + dtoc(date())+" "+ time()
strBody = "Hello you. Please find file attached."

theApp = CreateObject("Outlook.Application")
theNameSpace = theApp.GetNameSpace("MAPI")
theNameSpace.Logon(strProfile , strPassword)
theMailItem = theApp.CreateItem(0)

theMailItem.Recipients.Add( strRecipient )
theMailItem.Subject = strSubject
theMailItem.Body = strBody
theMailItem.Send
theNameSpace.Logoff
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform