Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

Returns an Element object representing the current text match.

Signature
C#
C#
<table class="diff-macro"><thead><tr><th class="diff-macro-title">unmigrated-wiki-markup</th></tr></thead><tbody><tr><td class="diff-macro-body"><pre>
 public Element Element{ get; }
</pre></td></tr></tbody></table>
Signature
vb.net
vb.net
Public <p>Public ReadOnly Property Element() As Element</p>Element
Example
 
Code Block
csharp
csharp
titleC#
            //--- Search for social security numbers using regular expressions and delete them.
          WordApplication app = new WordApplication();
          Document doc = app.Open(@"C:\somedoc.doc");
          SearchMatch[] matches = doc.Search("\s\d\d\d-?\d\d-?\d\d\d\d\s");
          foreach(SearchMatch match in matches)
          {
             match.Element.Delete();
          }
        
Code Block
vb.net
vb.net
titlevb.net
            '--- Search for social security numbers using regular expressions and delete them.
          Dim app As New WordApplication()
          Document doc = app.Open("C:\somedoc.doc")
          Dim matches As SearchMatch() = doc.Search("\s\d\d\d-?\d\d-?\d\d\d\d\s")
          For Each match As SearchMatch In matches
               match.Element.Delete()
          Loop
        
Example