View Single Post
  #4  
Old December 22nd 08, 09:47 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Save off attachment and start SQL stored procedure

If you want to execute your code when new items arrive rather than at timed
intervals you can use a script executed from a rule or you can directly
handle either the NewMailEx event or the Inbox.Items.Add event. The script
executed from a rule is a public macro with this signatu

Sub myRuleScriptOrWhateverName(item As MailItem)

For information on the Items.Add event search for "zaphtml" at
www.outlookcode.com and for NewMailEx just search on that there. There are
lots of code samples there for that sort of thing.

Whether it's Outlook or Excel or Word VBA or VB6, if you're using ADOB then
executing stored procedures is identical. Same for any other connection
method you want to use. That's what's out of scope for this group, we don't
delve into the intricacies of SQL Server or other DB work.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Webtechie" wrote in message
...
Ken,

Thanks for your response.

I found code to save off attachments. I just don't know how to execute
the
procedure upon arrival on new mail.

I know you can create a rule based on when mail arrives, but I didn't know
if you could run a VBA procedure that way.

I disagree about my question about SQL Server being outside the scope of
this forum.

If I need to run something from Outlook, to me that is in scope!

I wasn't sure if I could use the same ADO recordset commands that I used
to
connect EXCEL VBA to SQL Server in Outlook VBA.

Again thanks for your response.


Tony


Ads