我对你的代码也有一些问题(运行时错误438)。我用这段代码解决了问题(我添加了
Dim myOutlook As Outlook.Application
和
Set contactItem = myOutlook.CreateItem(olContactItem)
):
Public Sub CreateNewContact()
Dim myOutlook As Outlook.Application
Dim contactItem As contactItem
Set myOutlook = CreateObject("Outlook.Application")
Set contactItem = myOutlook.CreateItem(olContactItem)
contactItem.FullName = "Greg Thatcher"
contactItem.Email1Address = "gregt@xobni.com"
contactItem.BusinessTelephoneNumber = "415 555 1212"
contactItem.HomeTelephoneNumber = "415 555 1234"
contactItem.MobileTelephoneNumber = "415 555 1236"
contactItem.display
End Sub