Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-11-2011, 08:22 AM
simpleonline1234 simpleonline1234 is offline Need help on Macro 03- Find text - if text is blank then remove line Windows XP Need help on Macro 03- Find text - if text is blank then remove line Office 2003
Novice
Need help on Macro 03- Find text - if text is blank then remove line
 
Join Date: Feb 2011
Posts: 1
simpleonline1234 is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 02-25-2011, 02:28 AM
macropod's Avatar
macropod macropod is offline Need help on Macro 03- Find text - if text is blank then remove line Windows 7 32bit Need help on Macro 03- Find text - if text is blank then remove line Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
Reply

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

Other Forums: Access Forums

All times are GMT -7. The time now is 02:14 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft