Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Outlook Automation - Attachment
Message
From
28/10/2008 08:34:28
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Using Outlook Automation - Attachment
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01357634
Message ID:
01357634
Views:
64
Hi there

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
Next
Reply
Map
View

Click here to load this message in the networking platform