Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 01-17-2018, 03:40 PM
macropod's Avatar
macropod macropod is offline How to express "or" in VBA? (code included) Windows 7 64bit How to express "or" in VBA? (code included) 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

You don't need an OR test for what you've described; you need a LIKE test:
Code:
Sub DeleteLinesStartWith()
Dim i As Long
With ActiveDocument
  For i = .Paragraphs.Count To 1 Step -1
    With .Paragraphs(i).Range
      If LCase(Trim(.Words.First.Text)) Like "[!.•]" Then .Delete
    End With
  Next i
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
"Internet Connection Needed ... Error Code: 0-9" When Trying to use Online Repair millardjd Office 0 01-22-2015 07:54 AM
How to express "or" in VBA? (code included) How to get "Track Changes" to ignore "Field Code Changed"? Joey Cheung Word 2 10-31-2014 07:55 PM
Cross Reference Heading Number with the word "Section" included bblouin Word 5 12-20-2012 05:27 PM
How to express "or" in VBA? (code included) code "0020" appearing instead of space chracter in word docm, file radleyyeldar Word 1 07-30-2012 05:13 AM
How to express "or" in VBA? (code included) How to choose a "List" for certain "Heading" from "Modify" tool? Jamal NUMAN Word 2 07-03-2011 03:11 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:49 PM.


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