+ Reply to Thread
Results 1 to 15 of 15

Find pdf file within subdirectory to attach to email

Hybrid View

  1. #1
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Find pdf file within subdirectory to attach to email

    I was going to post shortened version and delete the commented .htmlBody line but got the Access error. Just uncomment the line above the short .htmlBody and delete the short version.

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Find pdf file within subdirectory to attach to email

    For those that want to try my method, here is a short test for the first file found part. See the commented thread for the aFFs() routine and supporting routine.

    '2nd part #5, https://www.excelforum.com/excel-programming-vba-macros/1146991-invalid-procedure-call-or-argument-error.html
    Sub Test_aFirstFile()
      Dim p As String, a, fn As String
      p = "d:\myfiles\excel\test\"
      a = aFFs(p, , True)
      fn = aFirstFile(a, "Test.xls")
      MsgBox fn
    End Sub
    
    Function aFirstFile(arrayFullPaths, aFile As String)
      Dim f
      On Error Resume Next
      f = Filter(arrayFullPaths, "\" & aFile, True, vbTextCompare)
      aFirstFile = f(0)
    End Function

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. can't find file with macro in current subdirectory
    By xi603 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-28-2017, 06:47 PM
  2. Browse for a file edit the file then attach it to an email
    By Bobbbo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-06-2016, 11:50 PM
  3. Attach a file that is open to an email
    By Bobbbo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-06-2016, 11:35 PM
  4. I need VBA to save file and attach file to email based on conditional statements
    By jcrowe31 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2014, 09:41 AM
  5. [SOLVED] Trying to create a .pdf and attach it to email, but get .xls file instead
    By sbrnard in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2013, 01:21 PM
  6. [SOLVED] Attach a file and email it using Excel.
    By Paul Morgan in forum Outlook Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2012, 09:32 AM
  7. Email workbook AND attach a separate file to the email
    By sgreni in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2009, 06:48 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1