I have a csv file with a list of names and email addresses (last,first,email) that I would like to create a VBScript to import into Outlook 2003 as a new contacts folder. I am distributing this to many users and the csv will be updated and sent out through email on a regular basis, so I would rather not use the Import Wizard. What I have come up with so far is below. It looks incomplete to me, but I am new to VBScripting so I am not sure what I am missing.
----------
Set objOutlook = CreateObject("Outlook.Application")
Set nms = objOutlook.GetNamespace("MAPI")
Set fld = nms.Folders("Personal Folders").Folders("JobCenter")
Set itms = fld.Items
strServer = "labsrv01"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile ("G:\contacts.csv", 1)
Do Until objTextFile.AtEndOfStream
strLine = objTextFile.Readline
tokens = Split(strLine, ",")
Set itm = itms.Add("IPM.Contact.FolderName")
itm.LastName = tokens(0)
itm.FirstName = tokens(1)
imt.EmailAddress = tokens(2)
Loop
--------
Thanks in advance, any help would be appreciated
----------
Set objOutlook = CreateObject("Outlook.Application")
Set nms = objOutlook.GetNamespace("MAPI")
Set fld = nms.Folders("Personal Folders").Folders("JobCenter")
Set itms = fld.Items
strServer = "labsrv01"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile ("G:\contacts.csv", 1)
Do Until objTextFile.AtEndOfStream
strLine = objTextFile.Readline
tokens = Split(strLine, ",")
Set itm = itms.Add("IPM.Contact.FolderName")
itm.LastName = tokens(0)
itm.FirstName = tokens(1)
imt.EmailAddress = tokens(2)
Loop
--------
Thanks in advance, any help would be appreciated