Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Upstate NY, New York, USA
    Posts
    78
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Search and replace ANSI character (VBA/Word 97)

    I have a user form, a portion of which pulls address information from a Groupwise address book. When the document merges, there are ANSI linefeed characters (Chr(10)) in the address itself. I don't understand how they get there but I need to be able to locate them in the address area and delete them through VBA. I have been unsuccessful in figuring this out. Thanks for any suggestions! <img src=/S/doh.gif border=0 alt=doh width=15 height=15>

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Search and replace ANSI character (VBA/Word 97)

    Pull your address info into a variable which you pass into a Replace function that will replace the Chr(10) with whatever you want ([space], Chr(13), etc.)

    Here's a well done Replace function for the 97 crowd:

    <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=vb&Number=37072&page=&v iew=&sb=&o=&vc=1#Post37072>This Post</A>
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Search and replace ANSI character (VBA/Word 97)

    You might want to replace the line feed with vbCrLf, which guarantees a valid "paragraph."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •