+ Reply to Thread
Results 1 to 4 of 4

VBA To Delete Hidden Text in Word

  1. #1
    Registered User
    Join Date
    07-13-2007
    Posts
    3

    VBA To Delete Hidden Text in Word

    I have a food shopping list- one item per line. Some lines are formatted as hidden (but are still visible), some aren't. I'm trying to output the non hidden lines to a new document. The problem with my existing code is that it works about 50% of the time. The other 50%, it erases the non hidden text. I'm working in Word 2003.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    08-06-2020
    Location
    Canada
    MS-Off Ver
    MS Office 2007
    Posts
    8

    Re: VBA To Delete Hidden Text in Word

    Have you found out where it comes from or when it occurs? There are multiple points in the code you gave where it could be coming from.

    When instantiating tstextfile via the fso.CreateTextFile call

    MyString containing garbage characters upon start

    Cells contain weird values (that .Clean couldn't catch)

  3. #3
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: VBA To Delete Hidden Text in Word

    wagonicfolding: Your reply has nothing to do with anything described by the OP. There is no 'fso.CreateTextFile call' or 'MyString' in the OP's code, and '.Clean' isn't a Word VBA method.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: VBA To Delete Hidden Text in Word

    Try:
    Please Login or Register  to view this content.

+ 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. [SOLVED] Delete row if row contains word text (is surrounded by other text)
    By BG1983 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-01-2016, 08:30 AM
  2. [SOLVED] if the rows containing specific text are hidden, delete a specifically named ole object
    By Willardio in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-24-2012, 02:36 PM
  3. [SOLVED] Delete all text in a cell until it gets to a word
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-12-2012, 09:52 AM
  4. Delete text so it says everything except for a specific word
    By Tenmakk in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-15-2012, 04:49 PM
  5. Can I delete text after a certain word?
    By Tenmakk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2012, 05:25 PM
  6. delete text from cell after a certain word
    By nervous_pilchard in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-21-2011, 11:28 AM
  7. [SOLVED] Excel should let me use hidden text (like MS Word) - Thanks
    By Les in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-30-2005, 05:10 PM

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