vb如何获得word文档的文档结构图内容,各位谢啦!

解决方案 »

  1.   

    楼主,我是这样理解你的题意:所谓“word文档的文档结构图”也不过是word文档,只不过是多了些特别的功能,所以我认为这个问题就归结为“如何在VB打开Word文档”。看看:
    http://community.csdn.net/Expert/topic/3549/3549637.xml?temp=.4134333
      

  2.   

    http://community.csdn.net/Expert/topic/3260/3261000.xml?temp=.1171533
      

  3.   

    http://search.csdn.net/Expert/topic/576/576300.xml?temp=.3341333http://search.csdn.net/Expert/topic/1548/1548798.xml?temp=.1098139
      

  4.   

    其实下边这段代码已经可以在vb6中把所有样式为标题1的标题显示出来的了,但在vb.net中,para.style的数据类型已不再是字符串,不能再比较了。看看能不能帮我变通一下。
    =============================================Dim app As New Word.Application
    Dim doc As Word.Documentapp.Visible = True
    doc = app.Documents.Open("e:\xxx.doc")Dim para
    For Each para In app.ActiveDocument.Paragraphs
       if para.style = "标题 1" then
          MsgBox app.activedocument.range.text
       end if
    Next para
      

  5.   

    用para.outlinelevel而不用para.Style. Outlinelevel 1-9 相当于标题级别1-9. OutlineLevel 10 为正文。