Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Mar 2001
    Location
    Bismarck, ND, USA
    Posts
    451
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Saving Email Attachments (2007)

    We receive software license information for our customers from the vendor via an email. The email body includes user name, password, expiration date, and some other fields. There is also an attachment which has the extension .lic. We would like to be able to copy the information from the body of the email into fields in an Access table for future reference. I think copy/paste is sufficient for that. What I'm wondering is this: is there a way to get that attachment into the table? What type of field will I need in the table? Is this even feasible? Thanks!
    egghead

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Saving Email Attachments (2007)

    You could use the new Attachment field type introduced in Access 2007, or an OLE field, but I think it would be better to save the attachments to disk, and to store the path and filename of the attachment in the Access table as a text field or hyperlink field.

  3. #3
    4 Star Lounger
    Join Date
    Mar 2001
    Location
    Bismarck, ND, USA
    Posts
    451
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Saving Email Attachments (2007)

    I'm using Access 2007, but most of the users will be using 2003, so I think the hyperlink might be best. However, if I use a hyperlink to the file, clicking the link will open the file. Since it's a file type that shouldn't necessarily be opened (.lic), I really only want the path hyperlinked and the file selected, not opened. There will be many files, so linking to the folder won't work. Also, for the person saving the attachments out of the e-mails, I want to keep that simple by having one folder for all of the attachments. Also, when opening a hyperlink there's always the warning message.

    So, any way to simply use the path and file name without opening the file? And any way to get rid of the warning message?
    egghead

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Saving Email Attachments (2007)

    If you don't want the files to be opened, you can use a text field containing the path and filename of the .lic files.

    I don't know what level of automation you want - should the database read the e-mails and extract the info, or should the user do that?

  5. #5
    4 Star Lounger
    Join Date
    Mar 2001
    Location
    Bismarck, ND, USA
    Posts
    451
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Saving Email Attachments (2007)

    <P ID="edit" class=small>(Edited by egghead on 04-Apr-08 02:45. Added screen shot of email)</P>The emails have one attachment and about eight lines of text. Each line of text will match a field in a record. As I'm imagining it, our data entry person will receive the e-mail, open it, then use the Office Clipboard to copy all of the eight values to be pasted into the table/form. Initially I was looking for a way for the attachment to be right-clicked and saved/pasted/or something into the database as well.

    Now I'm thinking the attachment will have to be saved to a folder. After all of the data is pasted in the table, a hyperlink could be used to show where the file is stored. However, I don't want the hyperlink to attempt to open the file. If I switch it to text there is no easy way for the data entry person to enter a path. It's so much easier to teach them to insert a hyperlink and click through the dialog box.

    As far as automation, I would love to be able to export directly from Outlook into Access. That would be my ideal.
    Attached Images Attached Images
    egghead

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Saving Email Attachments (2007)

    It is possible to read an e-mail using VBA, save the attachment and store its path in the database. See Automation 101 by WendellB. If you search this forum for Outlook.Application, you'll find examples of automating Outlook from Access.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •