K
Kevin with VBA question for importing from MS Oult
I have been importing contact names to MS Access from MS
Outlook with no problem except I want to use a string
variable to retrieve a value from a MS Outlook contact
item property (with the same name as the variable) and I
am getting a syntax error. Here is the abbreviated code I
am using:
Set olns = ol.GetNamespace("MAPI")
Set cf = olns.GetDefaultFolder(olFolderContacts)
Set objItems = cf.Items
strfld = "FullName"
' get first item in MS Outlook Contact folders
Set c = objItems.getfirst
strName = c(strfld) ' gives me a syntax error
Can anyone tell me what I am doing wrong. Would be
greatly appreciated.
Thanks,
Kevin
Outlook with no problem except I want to use a string
variable to retrieve a value from a MS Outlook contact
item property (with the same name as the variable) and I
am getting a syntax error. Here is the abbreviated code I
am using:
Set olns = ol.GetNamespace("MAPI")
Set cf = olns.GetDefaultFolder(olFolderContacts)
Set objItems = cf.Items
strfld = "FullName"
' get first item in MS Outlook Contact folders
Set c = objItems.getfirst
strName = c(strfld) ' gives me a syntax error
Can anyone tell me what I am doing wrong. Would be
greatly appreciated.
Thanks,
Kevin