Reply to: Makro Search Entity and Replace itJanuary 6, 2014 at 1:57 pm
thanks for your input. I'm close to the final solution but it doesn't work.
It seems like there is something wrong with the “IsLessThan” Method. I'm working in VBScript but that shouldn't be the problem.
ActiveDocument.Host.DisplayAlerts = 0
entRefToReplace = “nbsp”
textToInsert = ” “
Set rng1 = ActiveDocument.Range
Set rng2 = rng1.Duplicate
if rng2.ContainerName = “.ENTREF” Then
if rng2.ContainerNode.nodeName = entRefToReplace Then
rng2.Text = textToInsert
ActiveDocument.Host.DisplayAlerts = -1
It just replace nothing here. Maybe because there is no Element after the nbsp?