Results 1 to 3 of 3
  1. #1
    Stretholox is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    24

    ERROR: Cannot find this file. Verify the path and file name are correct

    Hello,



    I'm working with the email function of Access and I have it settup to email with an attachment. I have confirmed over and over that the file path I am telling it to use is correct but I continue to get this error described above.

    Here is a copy of the code I am using.


    Private Sub EmailRemediation_Click()
    Dim strInput As String
    Dim strMsg As String
    Dim strGetFilePath As String
    Dim strGetFileName As String
    strGetFilePath = "\\AHCDFS.AHC.UFL.EDU\FILES\DN\PERSONAL\stephenpaol ini\Desktop\Send Remediation\TabulaRasa.docx"
    strGetFileName = Dir(strGetFilePath)
    strMsg = "What email would you like to send to?"
    strInput = InputBox(Prompt:=strMsg, title:="Prompt Email")

    Email_Bcc = strInput
    Email_Body = "Sad things"
    Email_Subject = "Remediation Notice"
    On Error GoTo debugs
    Set Mail_Object = CreateObject("Outlook.Application")
    Set Mail_Single = Mail_Object.CreateItem(0)
    With Mail_Single
    .Subject = Email_Subject
    .To = Email_Send_To
    .cc = Email_Cc
    .BCC = Email_Bcc
    .Body = Email_Body
    .Attachments.Add (strGetFileName)
    .send
    End With

    debugs:
    If Err.Description <> "" Then MsgBox Err.Description
    End Sub


    Is there something else I should be looking at to figure out why this error keeps coming up?

  2. #2
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    Dubai
    Posts
    614
    I think
    .Attachments.Add (strGetFileName)
    should be changed to
    Code:
    .Attachments.Add (strGetFilePath)

  3. #3
    Stretholox is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    24
    Quote Originally Posted by amrut View Post
    I think should be changed to
    Code:
    .Attachments.Add (strGetFilePath)
    Yup. I'm silly. Well done.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 13
    Last Post: 12-12-2013, 07:22 PM
  2. Replies: 3
    Last Post: 07-30-2012, 02:16 PM
  3. Replies: 2
    Last Post: 05-25-2012, 07:36 AM
  4. Replies: 10
    Last Post: 03-04-2012, 12:17 AM
  5. path\file access error 75
    By PRASANNA in forum Programming
    Replies: 2
    Last Post: 04-25-2011, 04:50 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums