Hi, need help with this one!
In Navision 4.00 I create a To-Do as type = Meeting, synch with outlook to create a new appointment, all standard stuff so far, the problem arises with custom fields that I have added to the appointment form in Outlook ie/Navision ID, Navision Description.
How can I search the appointments to find the one just created and then populate the custom fields with fields out of a Navision table, I've tried the following but with no success:
VARIABLES:-
Name DataType Subtype Length
olApp Automation'Microsoft Outlook 11.0 Object Library'.Application
olNS Automation'Microsoft Outlook 11.0 Object Library'.NameSpace
olItem Automation 'Microsoft Outlook 11.0 Object Library'.AppointmentItem
olItems Automation'Microsoft Outlook 11.0 Object Library'.Items
olCFolder Automation'Microsoft Outlook 11.0 Object Library'.MAPIFolder
Prop Automation'Microsoft Outlook 11.0 Object Library'.UserProperty
S Char
Props Automation 'Microsoft Outlook 11.0 Object Library'.UserProperties
//Code
S := 39;
CREATE(olApp,FALSE);
olNS := olApp.GetNamespace('MAPI');
olCFolder := olNS.GetDefaultFolder(9);
olItems := olCFolder.Items;
//line below for testing purposes as my custom field has a value of 1
olItem := olItems.Find(STRSUBSTNO('[Navision ID] = %1%2%1',S,1));
Props := olItem.UserProperties; //DEBUGGER ERRORS HERE
Prop := Props.Item(('Navision ID'));
Prop.Value := 12345;
olItem.Save;
The error I receive is 'This automation variable has not been instantiated'.
Any help is much appreciated.
Comments
2) try also CREATE(olApp,TRUE);
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Props := olItem.UserProperties; //DEBUGGER ERRORS HERE
-Navman001
-Navman001
Check the Microsoft objects library for more info.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!