View Single Post
 
Old 01-17-2018, 04:30 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,359
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

Perhaps you should spend a few moments studying how the Like command works (it's there, in the VBA help file) instead of cobbling together whatever comes out of a thought bubble then complaining the code doesn't work. It works for what you described in your first post's second screenshot and the numbered paragraphs, which isn't what you're now saying it doesn't work with. Quite obviously, if you want to delete paragraphs like your first screenshot, another test is required. For example:
If LCase(Trim(.Words.First.Text)) Like "[A-Z][!.•]" Then .Delete

In any event, if what you're trying to do is to delete paragraphs with fewer than, say, 3 characters, an entirely different approach is called for. I'd be inclined to do it with a simple wildcard Find/Replace, which would be far faster than looping through all the paragraphs.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote