Forums     Knowledge Base     OfficeWriter Online     
 
 
This documentation is for
OfficeWriter v3.8.1
.NET Platform

View Docs for Another
Version or Platform

Programmer's Reference > WordApplication API > SearchMatch > Replace

Replace Method



Signature:

public void Replace ( String replaceWith )

Description:

Replaces this match with the specified string.

Parameters:

replaceWith     The replacement string.

Example:

[csharp]
WordApplication app = new WordAppliation();
Document doc = app.Open(@"C:\somedoc.doc");

IEnumerator searcherator = doc.Search("crimson");
while (searcherator.MoveNext())
{
SearchMatch match = (SearchMatch)searcherator.Current;
match.Replace("red");
}



Copyright 2007 © SoftArtisans, Inc. All Rights Reserved.