Sub Main '#Language "WWB-COM" Option Explicit Dim find_string As String Dim replace_string As String Sub Main Dim t As Topic Init() For Each t In ActiveDocument.Range(mmRangeAllTopics) FindAndReplace(t, find_string, replace_string) Next t End Sub Sub Init() find_string = "" replace_string = "" Begin Dialog UserDialog 550,133 ' %GRID:10,7,1,1 Text 40,35,160,14,"Property name:",.Text1 Text 40,63,170,14,"New property name:",.Text2 TextBox 210,35,310,14,.TextBox1 TextBox 210,63,310,14,.TextBox2 OKButton 430,91,90,21 End Dialog Dim dlg As UserDialog Dialog dlg find_string = dlg.TextBox1 replace_string = dlg.TextBox2 If find_string = "" Or replace_string = "" Then MsgBox "No valid entries for property names" Exit All End If End Sub Sub FindAndReplace(t As Topic, find_string As String, replace_string As String) If t.DataContainer.DataContainerType = mmDataContainerTypeCustomProperties Then Dim cp As CustomProperty For Each cp In t.DataContainer.CustomProperties.CustomPropertyCollection If find_string = cp.CustomPropertyName Then cp.CustomPropertyName = replace_string End If Next cp End If Dim f As Formula Dim s As String For Each f In t.Formulas s = f.Text s = Replace$(s, find_string, replace_string) f.Text = s Next f End Sub