|
-
May 19th, 2006, 09:24 AM
#1
Thread Starter
New Member
Parsing Word file
I have a word file ("word_heading_input.doc") that contains the text "1. Paragraph One" such that the "1." is a formatted header. When I run the following code, only "Paragraph One" is shown in the debug window. I would like to show all of the text ("1. Paragraph One"). Any recommendations?
Thank you very much!
Private Sub btn_paragraphs_range_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_paragraphs_range.Click
Dim wdApp1 As New Word.Application
Dim wdDoc1 As New Word.Document
wdDoc1 = wdApp1.Documents.Open("d:\word_heading_input.doc")
Dim Range1 As Word.Range
Range1 = wdDoc1.Paragraphs(1).Range
Dim range_string As String
range_string = Range1.Text
Debug.WriteLine("range paragraph is " & range_string)
wdDoc1 = Nothing
wdApp1.Quit()
wdApp1 = Nothing
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|