我想删除段落到Word文档中的特定点.

问题描述:

我正在使用此代码逐段显示内容,但是我想从特定的位置显示...这意味着我想删除前面的段落...

Am using this code for displaying the contents paragraph by paragraph but i want to display from a particular...that means i want to delete the previous paragraphs...

 For Each p In currentDocument.Paragraphs
                       If p.range.text.Trim().Length <> 0 Then
               list.Add(p.range.text)
           End If
       Next p 
currentIndex = currentIndex + 1
        TextBox1.Text = list(currentIndex)



所以现在我要删除段落直到特定段落.

在此先感谢....



so now i want to delete the paragraphs up to a particular paragraph..

Thanks in advance....

您是否能够识别要添加到列表框之外的段落?如果是,只需在段落文本中检查该条件即可.然后,您可以添加索引大于此边界段落的所有段落.

HTH
Are you able to identify the paragraph beyond which you want to add to the listbox? If yes, just check for that condition in the paragraph text. You can then add all paragraphs that have an index greater than this boundary paragraph.

HTH