Send email with attachments from Outlook to Access 2007

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mulamootil
    New Member
    • Jan 2010
    • 33

    Send email with attachments from Outlook to Access 2007

    Hi - Is it possible to send email attachments to an Access Database. I know that we can collect data using email messages. It would be nice if there was a way to send an email with an attachment and the attachment gets saved in a database. Do you guys have any suggestions/thoughts. Thanks for your help.

    Stan
  • beacon
    Contributor
    • Aug 2007
    • 579

    #2
    Hi Stan,

    Don't quote me on this, but I think you can setup an AutoRule in Outlook to run a script when email messages arrive. Once the email arrives, the script can open an instance of a database using either DAO or ADO and you should be able to manipulate the attachment.

    I can post an example of automating Access and using DAO if you want, but I haven't done anything with saving attachments. You may want to check out Sue Mosher's Outlook web site (www.outlookcode .com...it's got all kinds of info on just about everything Outlook.

    Hope this helps at least get you started...

    Comment

    • mulamootil
      New Member
      • Jan 2010
      • 33

      #3
      send email with attachments from outlook to access 2007

      Hi Beacon - I have been researching your suggestion over the weekend and I think I may be able to achieve what I am looking for. Please go ahead and post an example of automating Access and using DAO. I will let you guys know if I am able to succeed in this.Thanks again for the post.

      Stan

      Comment

      • beacon
        Contributor
        • Aug 2007
        • 579

        #4
        I don't claim to be an expert on this, so I can only take you so far. The following code will only help you insert a row in a table. As for the content, you'll have to check out the documentation for Outlook to find the VBScript to go with it.

        Code:
        DbOpenTable = 1
        
        Set Dbe = Application.CreateObject("DAO.DBEngine.36")
        	Set MyDB = Dbe.Workspaces(0).OpenDatabase("C:\Temp\db1.mdb")
        Set RS = MyDB.OpenRecordSet("tblTable", DbOpenTable)
        
        RS.AddNew

        Comment

        • MMcCarthy
          Recognized Expert MVP
          • Aug 2006
          • 14387

          #5
          I should point out here that in my opinion it is never a good idea to embed objects like email attachments in Access. Normal practice would be to save those objects elsewhere on your system (set up a folder for this purpose) and only insert a path or hyperlink to the file in your record.

          Mary

          Comment

          • mulamootil
            New Member
            • Jan 2010
            • 33

            #6
            Thanks Mary for the suggestion. I really hope that I don't waste time on saving these attachments to a hard drive first. I wish there was an easy way to just forward these emails to database from where I can retrieve (filter it using a PO, or item number or some other field)it anytime. I thought of using SharePoint at one time, however my IT dept says it's not the best option either. They are talking about using a package called 'KnowledgeLake' ... Anyways, thanks for all the help.

            stan

            Comment

            Working...