Hi,
I programmed an Outlook98-automation in C/AL that gets information out of Calendars from specified users. So far so good. But I don't succeed to set a filter on the "start"-date of the items. Normally you can use the VB-method "Restrict", but I guess I have to format my dates...
I have the following code :
txtFilter := '[Start] >= ''' + FORMAT(DateFrom) + ''' AND [Start] <= ''' + FORMAT(DateTo) + '''';
autFilterItems := autItems.Restrict(txtFilter);
Does anyone have a solution (fast) ???
Fozzie
May the source be with you
0
Comments
I couldn't find any copyright or license information on the files, so I guess it Ok to put it here in this forum, so I have sent it in an email to webmaster@mynavison.net, so I hope it's up there soon.
Best regards,
Erik P. Ernst
Erik P. Ernst
Navision Online User Group
I'm stuck on that one for weeks now and can't seem to find anyone willing to share this information
Rgds
Benny Giebens
Benny Giebens
autApp : automation : 'Microsoft Outlook 98 Object Model'.Application
autNS : automation : 'Microsoft Outlook 98 Object Model'.NameSpace
autRec : automation : 'Microsoft Outlook 98 Object Model'.Recipient
autFolder : automation : 'Microsoft Outlook 98 Object Model'.MAPIFolder
autItems : automation : 'Microsoft Outlook 98 Object Model'.Items
Your code should look like this :
CREATE(autApp);
autNS := autApp.GetNamespace('MAPI');
autRec := autNS.CreateRecipient(Name); //Name used in mailserver
autRec.Resolve;
//olFolderCalendar = 9 online
autFolder := autNS.GetSharedDefaultFolder(autRec,9);
autItems := autFolder.Items;
Use autItems to get your AppointmentItems, etc.
I must add that this code is written by my collegue Vincent Bague and that he deserves all credits ! Thanks VB !
May the source be with you
I finaly got over a important step for creating appointments in outlook via automation.
This is the code i use :
CREATE(Autapp);
Autns := Autapp.GetNamespace('MAPI');
Autrec := Autns.CreateRecipient('MAILUSER'); //Name used in mailserver
Autrec.Resolve;
//olFolderCalendar = 9 online
Autfolder := Autns.GetSharedDefaultFolder(Autrec,9);
autitem := Autapp.CreateItem(1);
autitem.Subject('TESTSUBJECT');
autitem.Start(010200D);
autitem.Location('BELGIUM');
autitem.Close(0);
autitem.Move(Autfolder);
CLEAR(Autapp);
Keypart being the move !!!
2 Problems still stay :
1) the problem with witch this thread started, how to set a begin and end time
2) I'cant find the item property 'SHOW TIME AS'
So if i can get these one resolved, I woumd be very happy !!!
Rgds
Benny Giebens
Benny Giebens