Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-16-2020, 04:06 AM
alex100 alex100 is offline Search and replace, with paragraphs and wildcards Windows 7 64bit Search and replace, with paragraphs and wildcards Office 2016
Advanced Beginner
Search and replace, with paragraphs and wildcards
 
Join Date: May 2020
Posts: 79
alex100 is on a distinguished road
Default Search and replace, with paragraphs and wildcards

I need to remove all the text between two keywords. So far I have been using this code:

Code:
With Selection
    .HomeKey Unit:=wdStory
    With Selection.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "START_KEYWORD(*)END_KEYWORD"
    .MatchWildcards = True
    .Replacement.Text = ""
    .Execute Replace:=wdReplaceAll
    End With
End With
Now I need the search function to include paragraphs too, like this...



Code:
.Text = "START_KEYWORD^p(*)END_KEYWORD"
The problem is that, in such cases, the script no longer works.

Can someone help me, please?

Alex
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Search and replace, with paragraphs and wildcards best way to use search/replace wildcards in this scenario? dylansmith PowerPoint 3 03-04-2023 08:55 PM
Search and replace, with paragraphs and wildcards Search and replace wildcards eduzs Word VBA 2 06-29-2019 03:01 AM
Search and replace, with paragraphs and wildcards Need Search and Replace Help w Wildcards Oberstfunster Word 2 12-06-2018 09:28 AM
Wildcards used for Search and Replace ChrisRick Word 2 03-09-2017 05:01 AM
Any wildcards search and replace in Powerpoint 2010? tinfanide PowerPoint 0 09-10-2011 02:17 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:28 AM.


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