![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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. |
Ads |
#2
|
|||
|
|||
![]()
There's no quick and easy answer, but I can guide you down the path.
First, this is a must read: How to process incoming messages in Microsoft Outlook: http://www.outlook-code.com/article.aspx?id=62 The next step is to become familiar with the Outlook Object Model: http://msdn.microsoft.com/en-us/library/bb208225.aspx Then basically you need to get a handle to the MailItem you want, and grab the Attachment object you want from MailItem.Attachments collection and call the Attachments.SaveAsFile method. See the example he http://msdn.microsoft.com/en-us/library/bb219926.aspx As for exporting the contents of the Excel attachment to SQL - that's not a question for an Outlook forum! You're looking at ODBC/OLE DB/ADO.NET and the Excel Object Model for that scenario. -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "manared" wrote: 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. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Grab URL and put in a mail (Outlook 2003) | jh[_3_] | Outlook - General Queries | 4 | March 14th 09 03:42 AM |
Grab URL and put in a mail (Outlook 2003) Indstillinger | No Name | Outlook and VBA | 0 | March 9th 09 09:09 AM |
Is this possible (Grab Outlook data from MS Access)? | Dorian | Outlook and VBA | 2 | February 26th 09 02:53 PM |
Grab emails as they are sent | Humphrey | Outlook and VBA | 2 | February 26th 09 02:46 PM |
Grab when user saves a form. | Flemming | Outlook and VBA | 1 | May 11th 06 01:49 PM |