C
Carol G
I am using Outlook 2000.
I am sure that this code worked once and then stopped working. It is meant
to update data to the outlook contactitem body from a button in an access
database. I check the outlook contact item and nothing is being transferred
into the body.
Any Ideas what I'm doing wrong?
Both strNameList and strNotes have the proper data in them.
Private Sub cmdOutlookExport_Click()
Dim strNameList as String
Dim strNotes as String
Dim fld As Outlook.MAPIFolder
Dim appOutlook As Outlook.Application
Dim nms As Outlook.NameSpace
Dim itms As Outlook.Items
Dim itm As Outlook.ContactItem
Set appOutlook = CreateObject("Outlook.Application")
Set nms = appOutlook.GetNamespace("MAPI")
Set fld = nms.GetDefaultFolder(olFolderContacts) 'Set what kind of folder
Set itms = fld.Items 'Outlook folder item
'Before being called Both strNameList and strNotes have the proper data in
them. This is 'checked in the For Each Loop below.
For Each itm In itms
If strNameList = itm.FullName Then
Debug.Print itm.FullName & " is found"
itm.Body = itm.Body & strNotes
Debug.Print itm.Body & " is itm.body"
End If
Next
MsgBox "Contact Updated Successfully"
Thanks
Carol
I am sure that this code worked once and then stopped working. It is meant
to update data to the outlook contactitem body from a button in an access
database. I check the outlook contact item and nothing is being transferred
into the body.
Any Ideas what I'm doing wrong?
Both strNameList and strNotes have the proper data in them.
Private Sub cmdOutlookExport_Click()
Dim strNameList as String
Dim strNotes as String
Dim fld As Outlook.MAPIFolder
Dim appOutlook As Outlook.Application
Dim nms As Outlook.NameSpace
Dim itms As Outlook.Items
Dim itm As Outlook.ContactItem
Set appOutlook = CreateObject("Outlook.Application")
Set nms = appOutlook.GetNamespace("MAPI")
Set fld = nms.GetDefaultFolder(olFolderContacts) 'Set what kind of folder
Set itms = fld.Items 'Outlook folder item
'Before being called Both strNameList and strNotes have the proper data in
them. This is 'checked in the For Each Loop below.
For Each itm In itms
If strNameList = itm.FullName Then
Debug.Print itm.FullName & " is found"
itm.Body = itm.Body & strNotes
Debug.Print itm.Body & " is itm.body"
End If
Next
MsgBox "Contact Updated Successfully"
Thanks
Carol