PDA

View Full Version : Grab info from attachment and put into SQL db



manared
09-01-2009, 11:57 AM
I'm very new to VBA, but have been programming with vb.net for several years now. What I would like to do is grab an attachment (excel), suck out all the information in that excel file and enter it into a SQL database. I have no clue how to do that using VBA and Outlook. I'd love to be able to have this done automatically when the email comes in, but if the user has to click a button to go through the inbox to grab the specific emails/attachments, that's alright. I just don't know how to get that attachment info to the database.

JP2112
09-01-2009, 01:45 PM
See http://www.codeforexcelandoutlook.com/outlook-vba/stock-event-code/ for stock event code you can adapt for your needs.

http://support.microsoft.com/kb/321686 has some sample code you should be able to use to do the importing.