Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-03-2013, 10:08 AM
donaldadams1951 donaldadams1951 is offline Find keyword in section & delete section Windows XP Find keyword in section & delete section Office 2010 32bit
Advanced Beginner
Find keyword in section & delete section
 
Join Date: Dec 2013
Location: San Francisco Bay Area
Posts: 37
donaldadams1951 is on a distinguished road
Default

Thanks for the input...

This is what I did to remove the sections and text I inserted into the document.



Code:
 
strSearchString = "Inst#: " & ReportInstance
 
With Selection.Find
 
  .ClearFormatting 
  .Replacement.ClearFormatting
  .Text = strSearchString
 
  .Replacement.Text = ""
 
  .Forward = True
  .Wrap = wdFindStop
  .Format = False
  .MatchWildcards = True
  .Execute
 
  ' what section am I in?
  If .Found = True Then
 
    intSectionCount = ActiveDocument.Range(0, Selection.Range.End).Sections.Count
 
 
    ActiveDocument.Sections(intSectionCount).Range.Delete
 
 
  End If
 
End With

Last edited by donaldadams1951; 12-03-2013 at 11:08 PM.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find keyword in section & delete section Deleting section break and retaining section properties New Daddy Word 6 02-03-2014 07:09 PM
Find keyword in section & delete section Section Break (Next Page) replaces Section Break (Continuous) when deleted Carlabasson Word 2 03-25-2013 10:13 PM
Footnotes in one column section forcing two column section start from a new page... thorin Word 1 12-19-2012 01:22 PM
Find keyword in section & delete section Can't Delete Section Breaks with ^b cheech1981 Word 8 07-11-2012 11:48 AM
Find keyword in section & delete section Copy/Paste/Delete Table & Section etc. flds Word VBA 40 07-16-2011 07:34 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:32 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