how to delete content in word between two strings
Sub DeleteTextBetweenTwoWords()
Dim strFirstWord As String
Dim strLastWord As String
Dim objDoc As Document
Dim objWord As Object
Set objDoc = ActiveDocument
strFirstWord = InputBox("Enter the first word:", "First Word")
strLastWord = InputBox("Enter the last word:", "Last Word")
With Selection
.HomeKey Unit:=wdStory
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = strFirstWord & "*" & strLastWord
.Replacement.Text = strFirstWord & strLastWord
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
End With
Set objDoc = Nothing
Set objWord = Nothing
End Sub