Ms word 如何从Microsoft word中删除多行

Ms word 如何从Microsoft word中删除多行,ms-word,Ms Word,我的word文件包含以下数据 product/productId: 0784010927 review/userId: A19V0VJMKKRMC8 review/profileName: jj "Justin" review/helpfulness: 1/1 review/score: 5.0 review/time: 1031961600 review/summary: one of my all tyime faves review/text: i am from this genrati

我的word文件包含以下数据

product/productId: 0784010927
review/userId: A19V0VJMKKRMC8
review/profileName: jj "Justin"
review/helpfulness: 1/1
review/score: 5.0
review/time: 1031961600
review/summary: one of my all tyime faves
review/text: i am from this genration which makes me different because i like movies from the 80s.  well this is a must see.

product/productId: 0784010927
review/userId: A3OZU2EMJQ5FIC
review/profileName: danielle levin
review/helpfulness: 1/1
review/score: 5.0
review/time: 1022025600
review/summary: The Best in the world
review/text: This movie has touched me so much it's great. The movie is about a a young girl who is a little daddy girl and does everything she is told until she met her love Johnny (Patrick Swayze). Baby (Jennifer Grey) learns not only how to dance
但是我想从每个段落中删除以review\text开头的那一行。我的输出应该是这样的

product/productId: 0784010927
review/userId: A3OZU2EMJQ5FIC
review/profileName: danielle levin
review/helpfulness: 1/1
review/score: 5.0
review/time: 1022025600
review/summary: The Best in the world
任何人都可以帮助我在Microsoft word或任何其他解决方案中使用宏

Sub Demo()
      With Selection.Find
        While .Execute(FindText:="review/text", Forward:=True)
          If .Found = True Then
            Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
            Selection.TypeBackspace
          End If
        Wend
      End With
End Sub
确保光标保持在文档的起始位置。

试试看

Sub Demo()
      With Selection.Find
        While .Execute(FindText:="review/text", Forward:=True)
          If .Found = True Then
            Selection.MoveDown Unit:=wdParagraph, Count:=1, Extend:=wdExtend
            Selection.TypeBackspace
          End If
        Wend
      End With
End Sub

确保光标保持在文档的起始位置。

您可以使用。这是一个用于操作word文件的JavaAPI。您可以使用。这是java API来操纵Word文件。@穆罕默德哈桑:考虑接受答案,这样社区就可以知道这是工作解决方案。@穆罕默德哈桑:考虑接受答案,这样社区就可以知道这是工作解决方案。