Outlook Automation attachments

Thad Bogert thad.bogert at rainingdata.com
Fri May 16 15:54:16 EDT 2008

Nice to see my code in use.  I wrote that back when I first started  
working for Omnis. :)

The following code should sort by descending version number:

Do lExternalsList.$cols.$add('ExternalName',kCharacter,kSimplechar, 
100)     ;; Create a list with a column for names of automation objects
Do lExternalsList.$cols. 
$add('ExternalVersion',kInteger,kLongint)     ;; Create a list with a  
column for versions of automation objects
Do $root.$extobjects.Automation Library.$objects. 
1,len(pString)))=upp(pString))     ;; Build a list of all Automation  
objects who
Do lExternalsList.$sort($ref.ExternalVersion,kTrue, 
$ref.ExternalName,kTrue)     ;; Put the most current version of the  
Object at the top of the list.
Do lTempRow.$cols.$add('Object',kObject,con(".Automation  
Library.Automation\",lExternalsList.1.ExternalName))     ;; Create an  
instance of the automation object inside a row variable
Quit method lTempRow.Object     ;; Return the object to the calling  

To use the code, you must have a version of Studio that has the rpos()  
function. (Studio 4.1)


On May 16, 2008, at 7:49 AM, Kelly Burgess wrote:

> Hi Michael,
>> But, the main question is, how can we determine which version of  
>> Outlook the user has installed?
> Your code is probably calling GetAutomationObject('Outlook')
> That method is designed to find the most current version on a system  
> that might have two or more versions.  But since it does an alpha  
> sort on the name, it's possible that Outlook9 would look newer than  
> Outlook10 as well as Outlook8, so it would be good to trace your way  
> through GetAutomationObject and observe when a given version name  
> might run that risk on a system that has 2+ versions.
> I don't know that there *is* an Outlook10.. I'm just saying when one  
> comes out, it'll be worth watching out for, but not an issue on a  
> machine with only one version present.
> Kelly

More information about the omnisdev-en mailing list