Avatar of Programm
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.ClearFormatting;
      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.ClearFormatting;
      OleObj.application.Selection.Find.Replacement.Text := strResponse;
      OleObj.application.Selection.Find.Execute(Replace := wdReplaceAll);
DelphiMicrosoft Word

Avatar of undefined
Last Comment
Programm

8/22/2022 - Mon
Ferruccio Accalai

In your code I see a Text replacement routine, not a bookmark deletion!
What do you really need? Where does this code come from?
ASKER CERTIFIED SOLUTION
Ferruccio Accalai

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Programm

ASKER
Thanks. I can use this solution to our old problem! :)
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck