Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 33
  1. #16
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    No, I believe that is a limitation of SendObject.
    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.

  2. #17
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I don't know of an acformat that would dictate delimited, qualifiers and such. I would use DoCmd.TransferText acExportDelim to save a file and then some code to attach the file. June provided a link to create an Outlook object and use Outlook to attach docs and send emails. Another option would be to use CDO's schemas.

  3. #18
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    OK Thank! I wish I could do it with ms access but only for one limitation I have to turn around and do extra work. Ah... MS never makes thing easy. why not text delimited option!

  4. #19
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Pasi View Post
    OK Thank! I wish I could do it with ms access but only for one limitation I have to turn around and do extra work.
    Not sure I understand what the extra work is about. Yes, you will have to create a text file becuase the built in method for SendObject will not know how to format the Delimited file. You can use the export wizard and save the procedure with a meaningful name. With the saved export procedure you can include the TransferText method. So not a lot of work really.

    I believe it would be something like this
    DoCmd.TransferText acExportDelim, "SavedProcedure", "AccessObjectName", "Path"

  5. #20
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    Sorry I am not following you? Don't mean to act dumb!

  6. #21
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    By 'extra work' do you mean the procedure that manipulates an Outlook object? Yes, it is a bit more code but not so difficult with the adequate examples provided.

    I just reread the first post. You said you are trying to run a script to find latest file in a folder. Why? If you just ran Access procedure that saved a text file then you have the file name available for use in subsequent code to send it as attachment to email.
    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.

  7. #22
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    Thanks. Yes at first I was trying to email it with .vbs code cause could not find a way to export the file from access as text delimited so I had to export it first and use a vbs method to email it. I am not too familiar with access to save the procedure? Sorry I am just learning access.

  8. #23
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    You said your 'script out put the .txt to a the folder' - what script? This is not a VBA procedure in the Access file? Post the code you are using.


    Maybe this will help http://office.microsoft.com/en-us/ac...010341717.aspx
    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.

  9. #24
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    I meant I have a vb/module script within my access file that exports my executed file into a my folder see below vba codes: this code exports the output file as text delimited with the time stamp and date file that I want. Now I just need a way to access this file in this folder---> "C:\Users\xxx\Desktop\Reports\Press-" & Format(Date, "mm-dd-yyyy") & ".txt" to send email as attachment to me.

    Public Function ConvertToText()
    DoCmd.TransferText acExportDelim, , "My file", "C:\Users\xxx\Desktop\Reports\Press-" & Format(Date, "mm-dd-yyyy") & ".txt"
    End Function

  10. #25
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Consider:

    Public Function ConvertToText()
    'export data to text file and send email
    Dim strFile As String
    strFile = "C:\Users\xxx\Desktop\Reports\Press-" & Format(Date, "mm-dd-yyyy") & ".txt"
    DoCmd.TransferText acExportDelim, , "My file", strFile
    'more code here to open Outlook object and send email with strFile as attachment
    End Function
    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.

  11. #26
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    Just wanted to thank you helping me with this! I am all set ! I was able to tailor the code to generate email and worked out some bug. I am up and running! Thanks again! You and June are great!

  12. #27
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Glad to hear you got it sorted out. Once you have some code examples in your files, it is not too difficult to implement in future projects.

  13. #28
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    Absolutely. That's what I was looking for. Thanks again!

  14. #29
    Pasi is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2013
    Posts
    38
    Sorry I have to ask you this but when I run this code

    strFile = "C:\Users\xxxx\Desktop\Reports\Press-" & Format(Date, "mm-dd-yyyy") & ".txt"
    DoCmd.TransferText acExportDelim, , "Myquery", strFile

    this runs fine but when I change the format date to & Format(Date, "mm/dd/yyyy") & ".txt" I get an error saying not a valid path???

    Any idea?
    Thanks,

  15. #30
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Can't use / character in the file name.
    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.

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 13
    Last Post: 12-05-2013, 06:04 PM
  2. Email with Access report as attachment
    By kmims44 in forum Programming
    Replies: 1
    Last Post: 07-18-2012, 02:38 PM
  3. Sending Report from Access as attachment in Email
    By taimysho0 in forum Programming
    Replies: 16
    Last Post: 02-09-2012, 12:07 PM
  4. Extract file attachment from email to Access
    By bet in forum Import/Export Data
    Replies: 3
    Last Post: 02-02-2011, 07:35 PM
  5. email attachment from Access
    By Gandalf in forum Queries
    Replies: 0
    Last Post: 01-22-2009, 10:03 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