Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Automating Outlook
Message
From
10/05/2004 16:27:10
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Automating Outlook
Miscellaneous
Thread ID:
00902594
Message ID:
00902594
Views:
61
Hi Everyones,

I'm sending a batch of personnalized email (actually month ends customer statements) using Outlook. I figured most of the things out but I'm stuck with a problem. I get an error message form VFP when I send the mail. The error says:

No error number, "The action cannot be complete because the "Boite d'envoie - Microsoft Outlook" program is not responding. Choose "switch to" to correct the problem."
I can choose "switch to" I can choose "retry" they both works fine.

If you need to see my code here it is:

** scan the customer table
*** Creates the cursor with all the data for the current customer
IF tcPrint = "EMAIL"
This.Print("PDF", "ARSTATEMENT_MAIL.FRX", .F., lcReportName, .T.)
oMessage = oOutlook.CreateItem(0)
WITH oMessage
.Subject = oT.C("YOUR STATEMENT", .T., &lcCurCust..cLang )
.Body = oT.M("FIND_STATEMENT", &lcCurCust..cLang ) + CHR(13) + ;
oT.C("THANK YOU.", .t. ,&lcCurCust..cLang )

.Attachments.Add(alltrim(sgcHomeDir) + "\Documents\"+ lcReportName+".PDF")
.Importance = 2 && High
oRecipient = .Recipients.Add(&lcCurCust..cCustID)
IF NOT oRecipient.Resolve()
wait windows "problème à gérer, ajout ne marche pas"
.Save()
ELSE
*.Save()
wait windows "A"
.Send() && Thsi is where the error occurs between the wait windows
wait windows "B"
ENDIF
ENDWITH
** endscan the customer table
Diane Robitaille eng.
Next
Reply
Map
View

Click here to load this message in the networking platform