title: How to find text inside word file that has different background?
body: <p>I need to search inside Word file and find all the text that has different background colors (highlighted) and write only the founded text into new word file. how I can do that ?</p>
  
  <p>I tried using this code:</p>
  
  <pre><code>uses ActiveX, ComObj;
  const
    wdFindContinue = 1;
    wdLine=5;
    wdStory = 6;
    wdExtend = 1;
    wdCharacter = 1;
  var
    OleObj: Variant;
  begin
    // create OLE object for MS Word application:
    OleObj := CreateOLEObject('Word.Application');
    // load a document from your file
    OleObj.Documents.Open(YourDocument);
    OleObj.Selection.Find.ClearFormatting;
    OleObj.Selection.Find.Text := strFinna;
    // WordApp.Selection.Find.Replacement.Text := yourNewStringForReplace;
    OleObj.Selection.Find.Forward := True;
    OleObj.Selection.Find.MatchAllWordForms := False;
    OleObj.Selection.Find.MatchCase := False;
    OleObj.Selection.Find.MatchWildcards := False;
    OleObj.Selection.Find.MatchSoundsLike := False;
    OleObj.Selection.Find.MatchWholeWord := False;
    OleObj.Selection.Find.MatchFuzzy := False;
    OleObj.Selection.Find.Wrap := wdFindContinue;
    OleObj.Selection.Find.Format := False;
    OleObj.Selection.HomeKey(unit := wdStory);
    while OleObj.Selection.Find.Execute do
    begin
      OleObj.Selection.EndKey(Unit := wdLine, Extend := wdExtend);
      OleObj.Selection.MoveRight(Unit := wdCharacter, Count := 1);
      OleObj.Selection.MoveUp(Unit := wdLine, Count := 1, Extend := wdExtend);
      OleObj.Selection.Delete(Unit := wdCharacter, Count := 1);
    end;
    OleObj.ActiveDocument.Save;
    OleObj.Quit;
    OleObj := Unassigned;
  end;
  </code></pre>
  
  <p>Is there any documentation for all office OLE Object methods ?</p>