J
JuanManuel
Hi,
The following is an excerpt of code that sets a range going from row 2 of a
table to the last row and Hides it. It is intended to hide the range only
when needed (i.e., when it is not already hidden).
'============== Excerpt ==================
If NumOfRows > 1 Then
Set TypeOfInspCell = ActiveDocument.Range( _
Start:=otable.Rows(2).Range.Start, _
End:=otable.Rows(NumOfRows).Range.End)
If TypeOfInspCell.Font.Hidden = True Then
Exit Sub
Else
TypeOfInspCell.Font.Hidden = True
End If
End If
'===========================================
Nevertheless, when debugging, I realized that "TypeOfInspCell.Font.Hidden"
is always equal to 9999999, so it always goes through the else (even when the
range is already hidden).
Let me note that the alternate method of checking whether row 2 of the table
is hidden or not, does not work, since it may very well happen that Row 2 is
hidden but row 3 is unhidden. I'd have to loop through each row to detect
whether they're all hidden. Although this method does give
"TypeOfInspCell.Font.Hidden" a defined value, due to the tables massive size
of the tables, it takes too long to run.
Is there anyway I could make my initial code work?? Or is there any other
efficient method to accomplish this?
Thank you,
Juan Manuel
The following is an excerpt of code that sets a range going from row 2 of a
table to the last row and Hides it. It is intended to hide the range only
when needed (i.e., when it is not already hidden).
'============== Excerpt ==================
If NumOfRows > 1 Then
Set TypeOfInspCell = ActiveDocument.Range( _
Start:=otable.Rows(2).Range.Start, _
End:=otable.Rows(NumOfRows).Range.End)
If TypeOfInspCell.Font.Hidden = True Then
Exit Sub
Else
TypeOfInspCell.Font.Hidden = True
End If
End If
'===========================================
Nevertheless, when debugging, I realized that "TypeOfInspCell.Font.Hidden"
is always equal to 9999999, so it always goes through the else (even when the
range is already hidden).
Let me note that the alternate method of checking whether row 2 of the table
is hidden or not, does not work, since it may very well happen that Row 2 is
hidden but row 3 is unhidden. I'd have to loop through each row to detect
whether they're all hidden. Although this method does give
"TypeOfInspCell.Font.Hidden" a defined value, due to the tables massive size
of the tables, it takes too long to run.
Is there anyway I could make my initial code work?? Or is there any other
efficient method to accomplish this?
Thank you,
Juan Manuel