J
john smith
Hi,
I tried to read per line from my table of content in the document and write
it 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.
Would anyone know how to read per line from the table of content until the
page break?
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 line from my table of content in the document and write
it 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.
Would anyone know how to read per line from the table of content until the
page break?
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