I've a word doc which contains a table with 3 rows and 6 columns of which one record is blank.I want to check for a blank row. How can i do that using VB 6.0. All suggessions are welcome.
Checking for a Blank Row
Collapse
X
-
dear whenevr ur reading any line try to use len(trim(<strin g>))=0 will give u blankOriginally posted by amitpI've a word doc which contains a table with 3 rows and 6 columns of which one record is blank.I want to check for a blank row. How can i do that using VB 6.0. All suggessions are welcome.
or trim(string)=vb nullstring do d same -
Hi. You will need to learn Ole Automation. Include ms word as a reference in your project and use word objects to access the table.Comment
-
The thing is that i want to check if there is any text in the cell for a particular row. How i can check whether all the cells of the row are blank or not. I'm using the below code for checking:
if any cell is blank it retuns two square boxes and when any text exists it returns more than 2 square boxes but not the text. So i get confused to check for the blank cell.Code:dim lsColVal as variant For liS = 1 To wrdFinApp.ActiveDocument.Tables(1).Rows(2).Cells.Count lsColVal = wrdFinApp.ActiveDocument.Tables(1).Cell(2, liS) If (Len(Trim$(lsColVal)) <> 0) Then lbCheck = False Exit For End If Next liSComment
-
What is the problem with this code? I didn't understnd the bit about it returning "2 square boxes".Originally posted by amitpThe thing is that i want to check if there is any text in the cell for a particular row. How i can check whether all the cells of the row are blank or not. I'm using the below code for checking:
if any cell is blank it retuns two square boxes and when any text exists it returns more than 2 square boxes but not the text. So i get confused to check for the blank cell.Code:dim lsColVal as variant For liS = 1 To wrdFinApp.ActiveDocument.Tables(1).Rows(2).Cells.Count lsColVal = wrdFinApp.ActiveDocument.Tables(1).Cell(2, liS) If (Len(Trim$(lsColVal)) <> 0) Then lbCheck = False Exit For End If Next liSComment
Comment