Public Sub CreateVar() 'Создание переменных - хранителей информации With ActiveDocument.Variables If Not ExistVar("Counter") Then 'Добавляем переменную .AddName:="Counter", Value:=0 End If End With End Sub Public Function ExistVar(Name As String) As Boolean 'Определяет наличие переменнойName в коллекции Variables Dim MyVar As Variable ExistVar = False For Each MyVar In ActiveDocument.Variables If MyVar.Name =Name Then ExistVar = True: Exit For End If Next MyVar End Function