473,472 Members | 2,224 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Checking for a Blank Row

49 New Member
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.
Mar 6 '07 #1
5 1482
vijaydiwakar
579 Contributor
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.
dear whenevr ur reading any line try to use len(trim(<string>))=0 will give u blank
or trim(string)=vbnullstring do d same
Mar 6 '07 #2
willakawill
1,646 Top Contributor
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.
Mar 6 '07 #3
amitp
49 New Member
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:

Expand|Select|Wrap|Line Numbers
  1. dim lsColVal  as variant
  2.  
  3. For liS = 1 To wrdFinApp.ActiveDocument.Tables(1).Rows(2).Cells.Count
  4.          lsColVal = wrdFinApp.ActiveDocument.Tables(1).Cell(2, liS)
  5.          If (Len(Trim$(lsColVal)) <> 0) Then
  6.                   lbCheck = False
  7.                   Exit For
  8.           End If
  9. Next liS
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.
Mar 7 '07 #4
amitp
49 New Member
Anybody having any idea to my question share with me.
Mar 8 '07 #5
Killer42
8,435 Recognized Expert Expert
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:

Expand|Select|Wrap|Line Numbers
  1. dim lsColVal  as variant
  2.  
  3. For liS = 1 To wrdFinApp.ActiveDocument.Tables(1).Rows(2).Cells.Count
  4.          lsColVal = wrdFinApp.ActiveDocument.Tables(1).Cell(2, liS)
  5.          If (Len(Trim$(lsColVal)) <> 0) Then
  6.                   lbCheck = False
  7.                   Exit For
  8.           End If
  9. Next liS
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.
What is the problem with this code? I didn't understnd the bit about it returning "2 square boxes".
Mar 8 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Dariusz | last post by:
I have a small form that on button press submits to a PHP file for further processing into a database. I have to change the script as it allows blank / nothing to be submitted to the database. ...
2
by: shank | last post by:
I use ASP to check users data they submit. In particular, I'm checking for credit cards and I also use a server component DynuCreditCard. It basically affirms that the number "could be" a real...
5
by: Sue | last post by:
As soon as a character is entered in the first field of a new record, the number of records shown in the navigation buttons increases by 1 and the new record button becomes enabled. In the...
12
by: Vicky | last post by:
What is the better way of checking blank string is it strvar.lenght > 0 or strvar == "" or something else Thnaks
4
by: Patient Guy | last post by:
Does anyone have any coding rules they follow when doing argument checking? When arguments fail during check, do you return from the call with an ambiguous return value, or do you throw...
42
by: =?Utf-8?B?UGxheWE=?= | last post by:
I have an if statement that isn't working correctly and I was wondering how I check for a blank string. My Code Example if me.fieldname(arrayIndex) = "" then ----- end if When I do this and...
7
by: elnoire | last post by:
Greetings! I've just started learning python, so this is probably one of those obvious questions newbies ask. Is there any way in python to check if a text file is blank? What I've tried to...
4
by: barmatt80 | last post by:
I have created an unbound form so that when users enter the information, there is a save button they have to click, checking to make sure a field(txtDocketNo) is not blank. For some reason I cannot...
1
by: SSG001 | last post by:
i have a form on which there are 4 rows in the one of the field user will be inputing value and when he is entring value in the second row on blur i have put a check if he is keying the same value...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.