[Resolved] Outlook Programming again...
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
Re: Outlook Programming again...
This thread may be better served in the Office Forum.
Re: Outlook Programming again...
thedoc1,
I am quite sorry that my suggestion made you so I upset that made give me a negative rep :confused:. My post was directed to the moderator as a heads up that this post would have received more responses that it has gotten so far. Never the less, I for one, will never ever again respond to any of your posts.
Remember, turn around is fair play, pal. :)
Re: Outlook Programming again...
Mark,
My bad...I clicked the wrong option when I went to give you a good report. My bad. I did not realized I did that until after I did it. Sorry - very long week and I was just not thinking that one out. My bad...
Any advice on the problem would be great. I appreciate the fact that you want to get more responses for my issue. Since it is a VB issue, it belongs here.
So, let's focus on the issue over worrying about other things.
Doc