+ Reply to Thread
Results 1 to 7 of 7

Text files not attaching to email correctly

  1. #1
    Registered User
    Join Date
    03-09-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    61

    Text files not attaching to email correctly

    Hi,

    I'm trying to send a few emails with some .txt files attached. It is sending the emails, along with text files, but the data within the text files are either missing or giving me weird Chinese symbols.

    Here is the code:

    Please Login or Register  to view this content.
    As I said, the email is sending no problem, with files attached, but the data within the files are corrupted. I've checked, and the links are referencing the correct files.

    Any ideas would be awesome!

    Thanks

    Mike

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Text files not attaching to email correctly

    It sounds like the text encoding of the text files is inconsistent, rather than it being the above code to attach the files to an email.

    How are the text files generated? Have you tried changing the encoding when you open the text file?
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    03-09-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Text files not attaching to email correctly

    Hi, thanks for the reply. I generate them through some R code. I haven't tried changing the encoding, how would I do that?

  4. #4
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Text files not attaching to email correctly

    Some R code? What is R code?

  5. #5
    Registered User
    Join Date
    03-09-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Text files not attaching to email correctly

    Its another programming language. I read some data in through Excel, pass it over to R which does the calcs (and generates the text files) and then passes it back to Excel, where I would like to now send the email.

  6. #6
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Text files not attaching to email correctly

    So, what happens if you open those text files immediately after R creates them before Excel does anything to them? Do they parse okay, or is the encoding still not right? If it's encoded wrong by the R routine, you have found your problem, and it's nothing to do with Excel!

    Feel free to attach one of the text files, I can check the encoding for you.

  7. #7
    Registered User
    Join Date
    03-09-2012
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    61

    Re: Text files not attaching to email correctly

    They open fine on their own. I can view them by opening the .txt file.

    Ok, I think I attached it to this message. Thanks again!
    Attached Files Attached Files

+ 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. Macro for attaching files into Outlook email - 95% complete but....
    By heatwave in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-07-2013, 01:30 AM
  2. [SOLVED] Imported Multiple Delimited Text Files Do Not Format Correctly
    By mike1199 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-18-2012, 09:22 PM
  3. Attaching files to an email
    By damage in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2011, 01:14 PM
  4. Attaching files to an email through excel
    By damage in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2011, 08:37 AM
  5. [SOLVED] Attaching One Worksheet to Email
    By KeshnerH in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2005, 04:06 PM

Tags for this Thread

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