+ Reply to Thread
Results 1 to 5 of 5

Can't seem to remove non printable characters

  1. #1
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Can't seem to remove non printable characters

    Outlook 2010
    I can't control what the user actually types. They're using a template so if they alter it and I can't find the info they'll get irritating pop up messages, but users will do as they wish.

    The BODY is something like this:

    Blah blah blah blah blah several rows and returns

    Title: [tab] The Title [return]
    [tab] [tab] More Info


    myStr using INSTR() to find "The Title"
    myStr = Mid(Item.Body, a, b)
    myStr might equal something like " The Title [return] [tab] "

    NONE of the FOLLOWING rid me of the non-printable characters
    myStr = Replace(myStr, Chr(9), "")
    myStr = Replace(myStr, Chr(10), "")
    myStr = Replace(myStr, Chr(13), "")
    myStr = Replace(myStr, Chr(16), "")
    myStr = Replace(myStr, vbLf, "")
    myStr = Replace(myStr, vbCrLf, "")
    myStr = Replace(myStr, vbNewLine, "")


    I'm using myStr in a SQL statement.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Can't seem to remove non printable characters

    I know nothing about VBA. However, in situations like this, I try to run the problem to ground using this formula:

    =CODE(MID($A$1,COLUMNS($A:A),1))

    copied across. I can then identify "problem" characters and deal with them. this way, you'll be able to see the codes of all caharacters and identify what's happening (hopefully)...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Can't seem to remove non printable characters

    This may help you identify the characters causing your problem
    Please Login or Register  to view this content.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  4. #4
    Forum Contributor
    Join Date
    08-14-2006
    Location
    USA
    MS-Off Ver
    2019
    Posts
    686

    Re: Can't seem to remove non printable characters

    Thanks Kev_

    Chr 160 non-breaksing space and
    Chr 32 space

    interesting that TRIM() didn't work but replace Chr 32 did!

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Can't seem to remove non printable characters

    you are welcome

+ 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. Printable hexadecimal characters
    By BroonsBane in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2016, 09:07 AM
  2. Remove Non-Printable Characters in excel
    By kisanvikas2015 in forum Excel General
    Replies: 5
    Last Post: 06-12-2015, 12:22 PM
  3. Non Printable Characters
    By bmilleruvm1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2012, 10:13 AM
  4. Non-Printable Characters
    By John Bates in forum Excel General
    Replies: 4
    Last Post: 08-26-2009, 04:58 PM
  5. Viewing non-printable characters
    By refresh in forum Excel General
    Replies: 1
    Last Post: 07-21-2006, 09:30 AM
  6. Replacing Non Printable Characters
    By SA3214 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-15-2005, 08:05 AM
  7. [SOLVED] Search and replace for non printable characters
    By ricl999 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-09-2005, 07:06 AM

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