Hey, awhile ago I posted here asking for help with outlook 2003 and my problems were resolved...however when I try working with outlook 2000...my code breaks. I have the following code for just adding a contact to outlook:
That works, but what I would like to do is...upon clicking the button that executes that code, I would like it to find the Contact folder named '123'...clear the contacts from it....then add the contact above. When I try working with addresslists (like I did in 2k3), I get errors saying Type Mismatch.Code:Dim ol As Outlook.Application Dim ns As Outlook.NameSpace Dim fl As Outlook.Folders Dim itmContact As Outlook.ContactItem ' grab Outlook Set ol = New Outlook.Application ' get MAPI reference Set ns = ol.GetNamespace("MAPI") ' Create new Contact item Set itmContact = ol.CreateItem(olContactItem) ' Setup Contact information... With itmContact .FullName = "James Smith" .Anniversary = "09/15/1997" ' saving b-day info creates info in the calendar .Birthday = "9/15/1975" .CompanyName = "Microsoft" .HomeTelephoneNumber = "704-555-8888" .Email1Address = "[email protected]" .JobTitle = "Developer" .HomeAddress = "111 Main St." & vbCr & "Charlotte, NC 28226" End With ' Save Contact... itmContact.Save Set ol = Nothing Set ns = Nothing Set itmContact = Nothing MsgBox "Done."




Reply With Quote