VB & Outlook

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lars54
    New Member
    • Dec 2006
    • 4

    #1

    VB & Outlook

    Happy New Year

    I'm having an issue with my Outlook 2003, a VB 6 program written some years ago seems causing an issue after closing Outlook.

    I'm logging time data into Appointment folder so after opening App folder and then closing it it seems to work but I canät manually add any data.

    This is the code opening Appointment folder and then it is closed by normal Archive/close

    Public Sub Appointment()

    Set myNameSpace = Application.Get Namespace("MAPI ")
    Set myFolder = myNameSpace.Get DefaultFolder(9 )
    Set Myexplorer = myFolder.GetExp lorer
    Myexplorer.Disp lay

    End Sub


    Any support is appreciated.

    Lars
  • Lars54
    New Member
    • Dec 2006
    • 4

    #2
    Just to share some experince.

    I found the reason for the partially lock on Outlook using my code. The full routine should be:

    Public Sub Appointment()

    Set myNameSpace = Application.Get Namespace("MAPI ")
    Set myFolder = myNameSpace.Get DefaultFolder(9 )
    Set Myexplorer = myFolder.GetExp lorer
    Myexplorer.Disp lay

    Set myNameSpace = Nothing
    Set myFolder = Nothing
    Set Myexplorer = Nothing


    End Sub

    The last 3 line obviously close the link with Outlook without closing the program itself.

    It seems working right now so thanks anybody who spent time thinking about this.

    Hopefully somebody more skilled can explain this better.

    Lars

    Comment

    Working...