Wordize provides C# developers with powerful high-level tools for programmatic modification of Word documents. By integrating search and replace capabilities into their .NET projects, developers can create robust solutions for comprehensive Word document updates.
Our interactive online demo with C# code examples helps you explore the possibilities of programmatic text search and replacement in Word documents. To try it, upload any Word file, specify the required search/replace strings, click the process button, and then download the modified Word file for verification.
using Wordize.Replacing;
Replacer.Replace("Input.docx", "Output.docx", "Text or RegEx", "Text or RegEx");
using Wordize.Replacing;
Replacer.Replace("Input.docx", "Output.docx", "Text or RegEx", "Text or RegEx");
using Wordize.Replacing;
using Wordize.Saving;
var imageStreams = Replacer.ReplaceToImages("Input.docx",
new ImageSaveOptions(SaveFormat.Docx), "Text or RegEx", "Text or RegEx");
foreach (var (stream, page) in imageStreams.Select((s, i) => (s, i)))
{
using var _ = stream;
stream.Position = 0;
using var file = File.Create($"Output_{page + 1}.docx");
stream.CopyTo(file);
}
using Wordize.Replacing;
FindReplaceOptions options = new FindReplaceOptions() { UseSubstitutions = true };
Replacer.Replace("Input.docx", "Output.docx", new Regex(@"Text or RegEx"), "Text or RegEx", options);
using Wordize.Replacing;
FindReplaceOptions options = new FindReplaceOptions() { UseSubstitutions = true };
Replacer.Replace("Input.docx", "Output.docx", new Regex(@"Text or RegEx"), "Text or RegEx", options);
using Wordize.Replacing;
using Wordize.Saving;
FindReplaceOptions options = new FindReplaceOptions() { UseSubstitutions = true };
var imageStreams = Replacer.ReplaceToImages("Input.docx",
new ImageSaveOptions(SaveFormat.Docx), new Regex(@"Text or RegEx"), "Text or RegEx", options);
foreach (var (stream, page) in imageStreams.Select((s, i) => (s, i)))
{
using var _ = stream;
stream.Position = 0;
using var file = File.Create($"Output_{page + 1}.docx");
stream.CopyTo(file);
}