Results 1 to 2 of 2
  1. #1
    tozey is offline Novice
    Windows XP Access 97
    Join Date
    Aug 2010
    Posts
    14

    Sending an attachment where the name contains todays date.

    Hello, I am having trouble with this part of my code.

    Set objOutlookAttach = .Attachments.Add("C:\Export\TTF" & "*" & ".xls")"

    above is the last attempt of getting it right, my file name is TTF190312.xls tomorrow it will be TTF200312.xls. I want my code to pick up this file.



    It is the only file in the folder, I just to be able to pick the file up daily and send it...I keep getting an error saying the path doesnt exist (even though it does)

    Any ideas how I can get this code to pick up my file regardless of what the 6 digit number is after the TTF.

    Thanks in advance

    Alex

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Can't use wildcard. Must specify file name. If you know the file will be there and name will include current date, try:

    ("C:\Export\TTF" & Format(Date(), "ddmmyy") & ".xls")"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Sending Report from Access as attachment in Email
    By taimysho0 in forum Programming
    Replies: 16
    Last Post: 02-09-2012, 12:07 PM
  2. Replies: 1
    Last Post: 12-12-2011, 06:32 AM
  3. If statement with Todays Date being criteria
    By robsworld78 in forum Access
    Replies: 2
    Last Post: 08-19-2011, 08:22 PM
  4. Adding todays date
    By EDEd in forum Forms
    Replies: 2
    Last Post: 10-08-2010, 06:27 PM
  5. Replies: 0
    Last Post: 07-06-2010, 08:12 AM

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