Link to home
Start Free TrialLog in
Avatar of Programm

asked on

MS word and Delphi

I am trying to delete line from MS word document from delphi program.

I can delete or remove bookmarks from the document but the line is still there.
How can I delete the line?

Here is my code.
Can I add some params to delete current line where my bookmark is?

      OleObj.application.Selection.Find.Text := strFinna;
      OleObj.application.Selection.Find.MatchCase := False;
      OleObj.application.Selection.Find.MatchWholeWord := False;
      OleObj.application.Selection.Find.MatchWildcards := False;
      OleObj.application.Selection.Find.MatchSoundsLike := False;
      OleObj.application.Selection.Find.MatchAllWordForms := False;
      OleObj.application.Selection.Find.Forward := True;
      OleObj.application.Selection.Find.Wrap := wdFindContinue;
      OleObj.application.Selection.Find.Format := True;
      OleObj.application.Selection.Find.Replacement.Text := strResponse;
      OleObj.application.Selection.Find.Execute(Replace := wdReplaceAll);
Avatar of Ferruccio Accalai
Ferruccio Accalai
Flag of Italy image

In your code I see a Text replacement routine, not a bookmark deletion!
What do you really need? Where does this code come from?
Avatar of Ferruccio Accalai
Ferruccio Accalai
Flag of Italy image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Programm


Thanks. I can use this solution to our old problem! :)