1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Finding files to attach to email sent by Access

Discussion in 'Business Applications' started by Chris_E, Jul 19, 2007.

Thread Status:
Not open for further replies.
  1. Chris_E

    Chris_E Thread Starter

    Joined:
    Feb 16, 2006
    Messages:
    360
    Hello chums

    I have a customer database with all of the tools to send emails to recipients from the database. That works great and, using "ClickYes", the level of unmanned sending gets me round spamming limits at the ISP level too.

    My latest request is to be able to add PDF (or other) attachments to the email.

    In my VBA code, I have a snippet of code that says:

    Code:
    With oMail
    .to = strEmailAddress
    .body = Me.txtEmailMessageContent.Value
    .Subject = Me.txtEmailSubjectMatter.Value
    .Attachments.Add ("C:\Documents and Settings\User\Desktop\testdocument.pdf")
    .Send
    End With
    With this code in place, Access sends the email to the variable 'strEmailAddress' with the attachment shown in the path, and hardcoded in VBA its great.

    I'd like however to be able to navigate to the file I want to attach, so its not dependent on the filename being coded.

    I once created some VB code (as opposed to VBA) that opens a dialogue box to let me nagivate to the file I want to choose, but, before I go around the houses, would that VB code (written in VB6) be suitable for my Access concept? Will it drop straight into my VBA?

    Hope VB/VBA gurus can guide me here!

    Thanks

    Chris
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/597739

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice