I'm working with delphi and need a method that does the following in the open word document look for a variable '@Name' if it finds the variable '@Name' open an inputQuery for the user to enter the new value of the variable and then replace the '@Name' with the value entered in the InputQuery.
Begin
if Doc.Content.Find.Execute(FindText := '@Ref') then
InputQuery('Nome Funcionario', 'Insira um Valor:', ref);
Doc.Content.Find.Execute(FindText := '@Ref', ReplaceWith := ref);
end;