0
I am working with Delhi and I need a method that does the following in the open word document look for a@Name variable if it finds the@Name variable open an inputQuery for the user to enter the new variable value and then replace@Name with the entered value in Inputquery.
Obs: the replacement part I already know my problem is even in the part of the algorithm go through the document and if it finds the variable return the inputQuery if it does not find just continue running the rest of the code.
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;
I would put the text content in a Memo, loop it through each character, and when I found@, store the following characters up to the next 'space' and replace them. After the entire process completed, it would save the contents of Memo to a . doc file.
– user75204
If you put the existing logic (code) it would be easier for the people here to help you.
– Alexandre Cavaloti
Thank you very much, but I’ve figured out how it works and it worked I will edit the publication with the code for better understanding
– Gustavo Cruz