Results 1 to 4 of 4

Thread: [Resolved] Outlook Programming again...

  1. #1

    Thread Starter
    Addicted Member thedoc1's Avatar
    Join Date
    Jan 2002
    Location
    Scenic Tonawanda, NY
    Posts
    143

    Resolved [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:
    1. Dim lsngR As Single
    2.     Dim objOlApp As Outlook.Application
    3.     Dim olNs As Outlook.NameSpace
    4.     Dim olFolder As Outlook.MAPIFolder
    5.     Dim olSetFolder As Outlook.MAPIFolder
    6.     Dim lintK As Integer
    7.     Dim olContact As Outlook.ContactItem
    8.     Dim olAllContacts As Outlook.Items
    9.    
    10.     Set objOlApp = New Outlook.Application
    11.     Set olNs = objOlApp.GetNamespace("MAPI")
    12.     Set olFolder = olNs.GetDefaultFolder(olFolderContacts)
    13.     mstrV = SLParmOutlook.mstrOutlookFolderName: Call TrimString
    14.     [COLOR=RoyalBlue]Set olSetFolder = olFolder.Folders(mstrV)[/COLOR]
    15.     Set olAllContacts = olSetFolder.Items
    16.    
    17.     For lintK = olAllContacts.Count To 1 Step -1
    18.         olAllContacts.Item(lintK).Delete
    19.     Next lintK
    20.    
    21.     Set olSetFolder = Nothing
    22.     Set olAllContacts = Nothing
    23.     Set objOlApp = Nothing
    24.     Set olNs = Nothing
    25.     Set olFolder = Nothing

    Thanks for your help.
    Dave
    Last edited by thedoc1; Jan 10th, 2007 at 11:35 AM. Reason: Resolved
    Thanks

    Doc

  2. #2
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Outlook Programming again...

    This thread may be better served in the Office Forum.
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  3. #3
    Giants World Champs!!!! Mark Gambo's Avatar
    Join Date
    Sep 2003
    Location
    Colorado
    Posts
    2,965

    Re: Outlook Programming again...

    thedoc1,

    I am quite sorry that my suggestion made you so I upset that made give me a negative rep . 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.
    Regards,

    Mark

    Please remember to rate posts! Rate any post you find helpful. Use the link to the left - "Rate this Post". Please use [highlight='vb'] your code goes in here [/highlight] tags when posting code. When a question you asked has been resolved, please go to the top of the original post and click "Thread Tools" then select "Mark Thread Resolved."


  4. #4

    Thread Starter
    Addicted Member thedoc1's Avatar
    Join Date
    Jan 2002
    Location
    Scenic Tonawanda, NY
    Posts
    143

    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
    Thanks

    Doc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width