Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Outlook Automation - Attachment
Message
 
 
À
28/10/2008 08:34:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01357634
Message ID:
01357635
Vues:
29
This message has been marked as the solution to the initial question of the thread.
You've to provide full file name
  .Attachments.Add(FULLPATH(lcAttachment))
>
>I'm using Outlook automation to send an email from within my foxpro program. I need to send an attachment, what is the property to use and the syntax to assign a file as the attachment. See code used for the rest of the email:
>
>
>
>   oOutLookObject = CreateObject("Outlook.Application")
>
>      oEmailItem = oOutLookObject.CreateItem(MAILITEM )
>      
>      WITH oEmailItem
>        .To = Buypledged.email
>        .Importance = IMPORTANCEMORMAL
>
>      
>         .Subject = ALLTRIM(shipfiles.buyer) + " Lot Pledged instructions loaded - File: " + ALLTRIM(shipfiles.filename)  
>         .Body = "Your pledged instructions have been loaded. The details are as follows: " + ;
>                 CHR(10) + CHR(10) + ;
>                 "Filename: " + ALLTRIM(ALLTRIM(shipfiles.FileName))+ ;
>                 CHR(10) + CHR(10) + ; 
>                 "Pledged Date: " + DTOC(DATE()) + ;
>                  CHR(10) + CHR(10) 
>     
>         .Body = .Body + CHR(10) + CHR(10) + ;           
>                 "Total lots in shipping instruction: " + ALLTRIM(STR(lnLotCnt))+ ; 
>                 CHR(10) + CHR(10) + ;       
>                 "Lot Details: " + ;
>                 CHR(10) + CHR(10) + ;
>                 "Sale    Season      Lot#      # of Bale    IntRef#    Buyer" + ;
>                lcLots + ;
>                 CHR(10) + CHR(10) + ;
>                 "*** End of Pledged Instruction ***"
>
>            .Send
>          ENDWITH  
>
>
>
>I've tried using .attachment.add('filename.xls'), but during runtime it caused an error.
>
>I would appreciate any help, please.
>
>Thanks
>
>Irene
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform