Thread: ALINES
View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default ALINES

I do not know what programming language you are using, but in VBA, if you
use

Dim LaData As Variant
LaData = Split("200|823757|MATTHEW H|BUTLER|9852 DUBLIN DRIVE||MANASSAS
|VA|20109|99", "|")
For i = 0 To UBound(LaData)
MsgBox LaData(i)
Next i

the null value is returned.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"Dorian C. Chalom" wrote in message
...
What if the data line looks like:
200|823757|MATTHEW H|BUTLER|9852 DUBLIN DRIVE||MANASSAS |VA|20109|99

it is not reading the Null field (||). How can I get it to create the
null field?

Thank you...

nlines = ALINES(laData, STRTRAN(cStrng, "|", CHR(13)))
DO CASE
CASE laData(1) = "200"
m.MemNum = laData(2)
m.FName = laData(3)
m.LName = laData(4)
m.MailAddr1 = laData(5)
m.MailAddr2 = ""
m.MailCity = laData(6)
m.MailState = laData(7)
m.MailZip = laData(8)
m.MailCode = laData(9)