Transfer Text File Name

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • apank
    New Member
    • Sep 2008
    • 31

    Transfer Text File Name

    Using VBA, is there a way to transfer text a table or query and have the saved file name be some text followed by today's date (example"newfil e.11.17.08.txt" ).

    Also can that file then be winzipped and emailed using VBA? I know how to email it, but I want to zip it first.

    Thank you for any help with this.
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    1. One thing at a time. The following code will Output the contents of the Employees Table, in a Delimited Format, to a Text File in the C:\Test\ Directory. The File's Name will look something like:
      Code:
      C:\Test\EmployeeTransfer11172008.txt
    2. Code Line:
      Code:
      DoCmd.TransferText acExportDelim, , "Employees", "C:\Test\EmployeeTransfer" & Format$(Date, "mmddyyyy" & ".txt")
    3. Is this what you are looking for?

    Comment

    • apank
      New Member
      • Sep 2008
      • 31

      #3
      Yes. Thank you very much. Makes sence. I will try that.

      Comment

      Working...