Answer the question
In order to leave comments, you need to log in
How to replace multiple variables in word using c#?
When entering variables into the Word like: {name} - the program replaces {name} with the entered name in the textbox, but if there are several of these variables {name} in the file, then it changes only 1, how to make the program change all variables with the name {name}?
Code example:
varname = textBox1.Text;
ReplaceWordStub("{name}", name, ref wordDocument);
Answer the question
In order to leave comments, you need to log in
Work with the document using the Open XML SDK.
Here is an example, replacing text in a file.
Find.Replace = wdReplaceAll; // значение константы: 2
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question