#1
|
|||
|
|||
Need help on Macro 03- Find text - if text is blank then remove line
I have a macro that I am working on right now and it daunting.
I need to be able to find text on the document and if the value next to the word is blank then delete the entire line and move the next line up. This is what I have coded so far but it doesn't do anything any ideas on how to get this one working? Thanks Code:
Dim RemoveLines As Field For Each RemoveLines In ActiveDocument.Fields If RemoveLines.Type = wdFieldCharacter Then End If Next RemoveLines |
#2
|
||||
|
||||
Hi simpleonline,
There is no such thing as .Type = wdFieldCharacter for a Word field. Perhaps you could explain a bit more about what kind of fields you're working with and what you mean by 'if the value next to the word is blank'. It also makes a big difference if the lines you refer to are separate paragraphs, as Word's concept of a line is affected by the current printer driver (which it uses to lay out the text on the page). Hence, you can get different results with different printers if you're working with lines within a paragraph.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro that will go to line # and center text | marge | Word VBA | 0 | 09-10-2010 12:30 PM |
Automatic insertion of blank pages or alternate text | Diopippo | Word | 0 | 07-06-2010 12:13 AM |
Using both drop down lists and blank cells for text | voltarei | Word | 0 | 03-18-2010 04:16 AM |
problem moving text to blank document | carolanshaw | Word | 0 | 03-23-2009 08:45 PM |
merging text into blank rolodex document | Saloei | Word | 0 | 01-31-2009 05:23 AM |