J
john smith
Hi,
I tried to read per word from my table of content below and write per
paragraph
into the text file.
It's not working since it only read the first 3 lines and after that I
always get 'bad parameter' message error due to tab error in the table of
content like:
1.3 Test
1.3.1 Error read this line.
Would anyone know how to read per word and write value per line in text file
until the
page break(end of page)?
Please help me...!
Thank you so much...
John
Part II Test Cases 8
1 Central Management Console (CMC) 8
1.1 CMC Sanity Check 8
1.2 Folders 10
1.3 Crystal Report 18
1.3.1 Add Report 19
1.3.2 Preview Report 23
1.4 Program and 3rd Party Objects 29
1.4.1 Add Objects 29
1.4.2 Program Object Viewing. 31
1.5 Categories 33
1.5.1 Create Category. 34
1.5.2 Modify Category. 35
1.5.3 Delete Category. 37
1.5.4 Assign Category. 38
1.5.5 Move Category. 39
1.5.6 Apply Rights to Category. 41
1.6 Universe (Sanity) 42
--------------------------page break-----------------------
Sub readtableofcontent()
Dim oRngH As Word.Range
Dim NextLine As Integer
Set oRngH = ActiveDocument.Range
NextLine = 2
With oRngH.Find
.Text = "Part II Table of Content"
.Font.Name = "Verdana"
.Font.Size = 10
If .Execute Then
oRngH.Move wdParagraph, NextLine
While
(oRngH.Application.ActiveDocument.Paragraphs.Last.Range.Text <> Chr(11))
oRngH.Move NextLine
NextLine = NextLine + 1
oRngH.Expand wdParagraph
objFile.writeLine (oRngH.Text)
Wend
End If
End With
end sub
I tried to read per word from my table of content below and write per
paragraph
into the text file.
It's not working since it only read the first 3 lines and after that I
always get 'bad parameter' message error due to tab error in the table of
content like:
1.3 Test
1.3.1 Error read this line.
Would anyone know how to read per word and write value per line in text file
until the
page break(end of page)?
Please help me...!
Thank you so much...
John
Part II Test Cases 8
1 Central Management Console (CMC) 8
1.1 CMC Sanity Check 8
1.2 Folders 10
1.3 Crystal Report 18
1.3.1 Add Report 19
1.3.2 Preview Report 23
1.4 Program and 3rd Party Objects 29
1.4.1 Add Objects 29
1.4.2 Program Object Viewing. 31
1.5 Categories 33
1.5.1 Create Category. 34
1.5.2 Modify Category. 35
1.5.3 Delete Category. 37
1.5.4 Assign Category. 38
1.5.5 Move Category. 39
1.5.6 Apply Rights to Category. 41
1.6 Universe (Sanity) 42
--------------------------page break-----------------------
Sub readtableofcontent()
Dim oRngH As Word.Range
Dim NextLine As Integer
Set oRngH = ActiveDocument.Range
NextLine = 2
With oRngH.Find
.Text = "Part II Table of Content"
.Font.Name = "Verdana"
.Font.Size = 10
If .Execute Then
oRngH.Move wdParagraph, NextLine
While
(oRngH.Application.ActiveDocument.Paragraphs.Last.Range.Text <> Chr(11))
oRngH.Move NextLine
NextLine = NextLine + 1
oRngH.Expand wdParagraph
objFile.writeLine (oRngH.Text)
Wend
End If
End With
end sub