Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

A SearchMatch object represents a match in the document found by using the method Element.Search.

Signature
C#
C#
<p> public sealed class SearchMatch
SearchMatch</p>
Signature
vb.net
vb.net
Public<p>Public NotInheritable Class SearchMatch
SearchMatch</p>
Example
Code Block
csharp
csharp
titleC#

          //--- Required for IEnumerator
          using System.Collections;
          ...
          WordApplication app = new WordApplication();
          Document doc = app.Open(@"c:\myDoc.doc");

          //--- Search a document for social security numbers, or any series of
          //--- nine digits, and remove them. The question mark after each dash
          //--- makes the presence of the dash optional.
          IEnumerator searcherator = doc.Search(@"\d\d\d-?\d\d-?\d\d\d\d").GetEnumerator();
          while (searcherator.MoveNext())
          {
               SearchMatch match = (SearchMatch)searcherator.Current;
               match.Element.DeleteElement();
          }
        
Code Block
vb.net
vb.net
titlevb.net

          '--- Required for IEnumerator
          Imports System.Collections
          ...
          Dim app As New WordApplication()
          Dim doc As Document = app.Open("c:\myDoc.doc")

          '--- Search a document for social security numbers, or any series of
          '--- nine digits, and remove them. The question mark after each dash
          '--- makes the presence of the dash optional.
          Dim searcherator As IEnumerator = doc.Search(@"\d\d\d-?\d\d-?\d\d\d\d").GetEnumerator()
          While searcherator.MoveNext()
               Dim match As SearchMatch = searcherator.Current
               match.Element.DeleteElement()
          End While
        

...

Name

Description

Element

Excerpt Include
WW8:SearchMatch.ElementWW8:
SearchMatch.Element
nopaneltrue

GroupCount

Excerpt Include
WW8:SearchMatch.GroupCountWW8:
SearchMatch.GroupCount
nopaneltrue

...

Name

Description

Group(Int32)

Excerpt Include
WW8:SearchMatch.Group(Int32)WW8:
SearchMatch.Group(Int32)
nopaneltrue

Replace(String)

Excerpt Include
WW8:SearchMatch.Replace(String)WW8:
SearchMatch.Replace(String)
nopaneltrue