John Colby
jwcolby at ColbyConsulting.com
Fri Jan 6 09:49:47 CST 2006
Gustav, In this specific case (and in 9x% of all businesses?) the client does use outlook. Outlook has a programming model, where I can iterate mail folders, iterate messages in that folder's message collection, iterate attachments to each message's attachments collection etc. You would not believe the work out there in programming Outlook simply because so many companies use it. >If a hit exists, the mail is downloaded, the attachment saved and a batch file is called which unzips the attachment, processes it (by calling an Access app), zips the processed file and mail it - and logs it all for reference. And I do all of this kind of stuff (including the zip/unzip) from right inside of VBA. No batch files, no having the batch file call some other app etc. Each step of my process logs statuses etc. I know that other approaches exist but whipping out code all inside of Access VBA is much cleaner where it is possible. I am going to need to learn the workaround of the Outlook Send security crap this time though. John W. Colby www.ColbyConsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Friday, January 06, 2006 6:31 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Withevents and object library version Hi John You could add Outlook as a Reference by GUID specifying Major and Minor version no. Start from top (Outlook 2003) and continue until it doesn't fail. Or maybe you could specify 0 for both Major and Minor and the current version will be referenced - that is how it is supposed to work, but I haven't found this method to work reliably. Remember that the code will be left uncompiled, thus you need to recompile which is not that easy ... if you recall the old threads on this. By why use Outlook? It's a monster. If a client doesn't use Outlook then what to do? Couldn't you just let a rule forward those mails to a known environment, then poll that at some interval? For a specific purpose we did that. An old 266MHz machine runs The Bat! client which polls via POP3 every five minute. If a hit exists, the mail is downloaded, the attachment saved and a batch file is called which unzips the attachment, processes it (by calling an Access app), zips the processed file and mail it - and logs it all for reference. Not as sexy as WithEvents, I know, but it works. /gustav >>> jwcolby at ColbyConsulting.com 05-01-2006 23:58 >>> I am starting dev on a little app to strip attachments off of outlook emails and file them on the disk. In order to do this I have to grab an instance of outlook and sink events for it (emails hitting a sub-folder). My issue is that of all the Office applications, Outlook is the ONE app that the Office install only allows you to keep a single version of. Thus I have an issue developing in it since my version is 2003 and most of my clients have 2002. I can do everything else just using late binding but sinking events just requires knowing the object type at compile time. Does anyone have reliable code for determining which version of Outlook is installed and referencing that lib at run time? John W. Colby www.ColbyConsulting.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com