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 > Element > Search

Search Method



Signature:

public SearchMatch[] Search ( String toMatch )

Description:

Searches for a specified string and returns an Iterator that can be used to iterate over the results.

Parameters:

toMatch     The string to find.

Returns:

SearchMatch[]

Example:

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

IEnumerator searcherator = doc.Search("\s\d\d\d-?\d\d-?\d\d\d\d\s");
while (searcherator.MoveNext())
{
SearchMatch match = (SearchMatch)searcherator.Current;
match.Element.Delete();
}



Copyright 2007 © SoftArtisans, Inc. All Rights Reserved.