V
Vagabound_s
Hi,
I am trying to create a macro which will identify and list the cutting
contents in a word document by employing following tasks:
1) seach for all instances of negative paragraph indent and list the
references in a list box
2) search for tables with HeightRule = wdRowHeightExactly so as to check the
instances where text is wraping below the row height
3) search for all instances of text going beyound page margins due to
incorrect tab stop
I tried using "find" for above tasks, however unable to get it work, since i
could not write condition such as ActiveDocument.Paragraphs(i).LeftIndent <
0
I am sure if it works it will be most efficient
Finally I got the first two tasks work using loop, However it is very
inefficient and takes long time. The code are listed below:
Sub findNegativeIndent()
For i = 1 To ActiveDocument.Paragraphs().Count
If ActiveDocument.Paragraphs(i).LeftIndent < 0 Then
UserForm1.NegativeList.Visible = True
UserForm1.NegativeList.Enabled = True
UserForm1.NegativeList.AddItem (i)
End If
Next
End Sub
Sub FindRowHeight()
For i = 1 To ActiveDocument.Tables().Count
If ActiveDocument.Tables(i).Rows.HeightRule = wdRowHeightExactly And
ActiveDocument.Tables(i).Rows.Height = InchesToPoints(0) Then
UserForm1.IndentList.Visible = True
UserForm1.IndentList.Enabled = True
UserForm1.IndentList.AddItem (i)
End If
Next
End Sub
Does anyone have better idea?
I am trying to create a macro which will identify and list the cutting
contents in a word document by employing following tasks:
1) seach for all instances of negative paragraph indent and list the
references in a list box
2) search for tables with HeightRule = wdRowHeightExactly so as to check the
instances where text is wraping below the row height
3) search for all instances of text going beyound page margins due to
incorrect tab stop
I tried using "find" for above tasks, however unable to get it work, since i
could not write condition such as ActiveDocument.Paragraphs(i).LeftIndent <
0
I am sure if it works it will be most efficient
Finally I got the first two tasks work using loop, However it is very
inefficient and takes long time. The code are listed below:
Sub findNegativeIndent()
For i = 1 To ActiveDocument.Paragraphs().Count
If ActiveDocument.Paragraphs(i).LeftIndent < 0 Then
UserForm1.NegativeList.Visible = True
UserForm1.NegativeList.Enabled = True
UserForm1.NegativeList.AddItem (i)
End If
Next
End Sub
Sub FindRowHeight()
For i = 1 To ActiveDocument.Tables().Count
If ActiveDocument.Tables(i).Rows.HeightRule = wdRowHeightExactly And
ActiveDocument.Tables(i).Rows.Height = InchesToPoints(0) Then
UserForm1.IndentList.Visible = True
UserForm1.IndentList.Enabled = True
UserForm1.IndentList.AddItem (i)
End If
Next
End Sub
Does anyone have better idea?