Hi All,
I am having troubles using the Outlook automation when using the NAS. I wrote some code to create an appointment trough automation. When I run the codeunit manually it works fine, without having to confirm 'outlook wants to send an e-mail' message.
When i try to run my codeunit with the NAS, it hangs on following line:
paut_Item.Send (this is the AppointmentItem variable)
Is there a limitation of the NAS that I am not aware about, or IS it possible to use outlook automation with the NAS and am I doing something wrong?
A piece of my code:
CREATE(gaut_App);
laut_Ns := gaut_App.GetNamespace('MAPI');
laut_Rec := laut_Ns.CreateRecipient('PLANNING'); //Name used in mailserver
gaut_Folder := laut_Ns.GetSharedDefaultFolder(laut_Rec,9);
laut_Item := gaut_App.CreateItem(1);
pdat_DateFrom := TODAY - lint_Temp;
laut_Item.Start := DATI2VARIANT(pdat_DateFrom, ltim_Time);
laut_Item.Subject := prec_ActionLine."Project Leader" + ': ' + prec_ActionLine."Line No.";
laut_Item.Body := 'Dit actiepunt werd u toegewezen door ' + prec_ActionLine."Created By" +
FORMAT(lchr_13) + 'Omschrijving actiepunt: ' + prec_ActionLine.Description;
laut_Item.Duration := 30;
laut_Item.Categories('VCO alert');
laut_Item.ReminderSet := FALSE;
laut_Item.RequiredAttendees := prec_Resource."E-mail";
laut_Item.MeetingStatus := 1;
laut_Item.Duration := 30;
IF pdat_DateFrom <> pdat_DateTill THEN BEGIN
laut_Reccur := paut_Item.GetRecurrencePattern;
laut_Reccur.RecurrenceType := 0;
pdat_DateFrom := TODAY - lint_Temp;
laut_Reccur.PatternStartDate := DATI2VARIANT(pdat_DateFrom, ltim_Time);
lint_Temp := TODAY - pdat_DateTill;
pdat_DateTill := TODAY - lint_Temp;
laut_Reccur.PatternEndDate := DATI2VARIANT(pdat_DateTill, ltim_Time);
END;
laut_Item.Save;
laut_Item.Send;
To repeat myself: when running this code manually, no probs!!
Thanks in advance.
0