我想删除段落到Word文档中的特定点. [英] i want to delete the paragraphs up to particular point in word document.

查看:118
本文介绍了我想删除段落到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


这篇关于我想删除段落到Word文档中的特定点.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆