Hi there,
it might be possible that anyone else already had this problem.
I want to do some automation with Outlook.
CREATE(olApp);
olFolder := olApp.GetNamespace('MAPI').GetDefaultFolder(5);
olExplorer := olApp.Explorers.Add(olFolder,0);
The olExplorer-Variable is set up with "WITHEVENTS = YES". But when trying to compile this piece of code an error occurs saying that it's not permitted to assign something to a variable that is withevents-activated.
Now the question is, is there any way to do this thought? I really need the SELECTIONCHANGE-Event from the Explorer-Object.
Thanx in advance for any suggestion.
Comments
'Microsoft Outlook 12.0 Object Library'.ExplorerEvents
1. Accodring to Microsoft, the ExplorerEvents are intended for internal use
2. How would I assign the ExplorerEvents to react on the Events of my Explorer-Object?
The worst thing is, that it's not possible to "CREATE" the Explorer-Object. It MUST be assigned
I found already existing, but i guess forgotten topic about this strange limitation for automations:
IF WithEvents property is set to true, then no assignment to variable can be done.
Problem: my variable has to be initiated from other one's function so assignment is necessary here...
But also for me this variable without events makes no sense at all... So maybe someone discovered workarounds how to
manage both things for that variable ? Automation is 'Microsoft Speech Object Library'.SpSharedRecognizer
write your own comvisible class with implemented object 'Microsoft Speech Object Library'. Add “load” method to your class to put that object from outside. Catch the object’s events within the class and bypass them to Navision with your custom event. On Navision create automation with events, load variable and wait for events.
Good luck!