Cannot update Location field in Contacts - Runtime Error 438

Status
Not open for further replies.

Laser

Member
Outlook version
Email Account
POP3
There seems to be a vast array of information regarding Outlook 2003 including information on how Microsoft love to change default field names. I'm guessing that may be my problem, or maybe it's an object problem - but I look to fellow Outlook 2003 users for assistance. Any help would be appreciated.

My code is as follows:

Dim olApp As Outlook.Application

Dim myNameSpace As Outlook.NameSpace

Dim objFolder As Outlook.MAPIFolder

Dim objItems As Outlook.Items

Dim objItem As Object, objAdd As Object

Dim new_no As String

Set olApp = CreateObject("Outlook.Application")

Set myNameSpace = olApp.GetNamespace("MAPI")

Set objFolder = myNameSpace.GetDefaultFolder(olFolderContacts)

Set objItems = objFolder.Items

For Each objItem In objItems

With objItem

If .Class = olContact Then

> OtherAddressCountry = "" ' This line works fine and other fields can also be updated

> Location = "" ' However this line generates runtime error 438

objItem.Save

End If

End With

Next
 
Status
Not open for further replies.
Top