I want to remove the empty paragraph mark using GREP search?
I am using the following code to find the empty paragraph mark the code finds the search but replace is not done perfectly.
Dim Occurances
indesignApplication.FindGrepPreferences = InDesign.idNothingEnum.idNothing
indesignApplication.ChangeGrepPreferences = InDesign.idNothingEnum.idNothing
indesignApplication.FindChangeGrepOptions.includeFootnotes = False
indesignApplication.FindChangeGrepOptions.includeHiddenLayers = False
indesignApplication.FindChangeGrepOptions.includeLockedLayersForFind = False
indesignApplication.FindChangeGrepOptions.includeLockedStoriesForFind = False
indesignApplication.FindChangeGrepOptions.includeMasterPages = False
indesignApplication.FindGrepPreferences.findwhat = "\r(?=\r)"
Occurances = indesignApplication.ActiveDocument.FindGrep()
indesignApplication.ChangeGrepPreferences.changeto = ""
If Occurances.Count <> 0 Then
For foundindex As Integer = 1 To Occurances.Count
Dim foundItem = Occurances.Item(foundindex)
Dim insertionPoint As InsertionPoint = foundItem.InsertionPoints.FirstItem
foundItem.Select()
foundItem.showtext
indesignApplication.Selection(1).ChangeGrep()
Next
End If
indesignApplication.FindGrepPreferences = InDesign.idNothingEnum.idNothing
indesignApplication.ChangeGrepPreferences = InDesign.idNothingEnum.idNothing


