Automation with Outlook

Michael_WeigandMichael_Weigand Member Posts: 14
edited 2000-03-03 in Navision Financials
I try to send a mail with Outlook. It works fine, but I can't fill the To: line. Below is the code I use.

---
CREATE(OutlookApplication);
OutLookMailItem := OutlookApplication.CreateItem(0); // 0 = E-Mail
OutLookMailItem.Body := txtBody;
OutLookMailItem.Subject := txtSubjekt;

// OutLookMailItem.To := ToName;

OutLookMailItem.CC := CCName;
OutLookMailItem.Send;
CLEAR(OutlookApplication);
---

Navision rejects the line with OutLookMailItem.To. The error message in German is:

"Es wurde ein Feld einer Datensatzvariablen erwartet. Zum Beispiel:

Datensatz.Feld
Debitor.Name"

What am I doing wrong?

Comments

  • BayBay Member Posts: 5
    TO is a reserved word in C/AL!

    To solve your problem you have to
    quot the string like OutLookMailItem."To".

    [This message has been edited by Bay (edited 03-03-2000).]
  • Michael_WeigandMichael_Weigand Member Posts: 14
    That was the solution. Thanks!
Sign In or Register to comment.