This problem has been resolved. The line was incorrect and I found a better way of handling it. Thanks for viewing this post and giving feedback.
Again, Mark, I apologize for the incorrect post to the reputation. It was my fault. When I can, I will add to your reputation again positively.
Doc
I am working on creating contacts in outlook using Vb. I have the following code to remove the contacts in the folder the user selects. It has no problems in Outlook 2000, 2002 and XP. One machine is having issues using Outlook 2003. It fails on the line that is blue below. Any thoughts?
VB Code:
Dim lsngR As Single Dim objOlApp As Outlook.Application Dim olNs As Outlook.NameSpace Dim olFolder As Outlook.MAPIFolder Dim olSetFolder As Outlook.MAPIFolder Dim lintK As Integer Dim olContact As Outlook.ContactItem Dim olAllContacts As Outlook.Items Set objOlApp = New Outlook.Application Set olNs = objOlApp.GetNamespace("MAPI") Set olFolder = olNs.GetDefaultFolder(olFolderContacts) mstrV = SLParmOutlook.mstrOutlookFolderName: Call TrimString [COLOR=RoyalBlue]Set olSetFolder = olFolder.Folders(mstrV)[/COLOR] Set olAllContacts = olSetFolder.Items For lintK = olAllContacts.Count To 1 Step -1 olAllContacts.Item(lintK).Delete Next lintK Set olSetFolder = Nothing Set olAllContacts = Nothing Set objOlApp = Nothing Set olNs = Nothing Set olFolder = Nothing
Thanks for your help.
Dave




Reply With Quote