none
Outlook 2013 to open certain contact at startup RRS feed

  • Question

  • Hi ...

    Is there a way to open a certain contact at startup in Outlook 2013?

    regards


    mvh/regards Øyvind Granberg 6391 Tresfjord Norway

    Monday, November 30, 2015 1:02 PM

Answers

  • Sure. The Display method of the ContactItem class displays a new Inspector object for the item.

    You may consider handling the Startup  event of the Application class which is fired when Microsoft Outlook is starting, but after all add-in programs have been loaded. For example:

    Private Sub Application_Startup()  
     MsgBox "Welcome, " & Application.GetNamespace("MAPI").CurrentUser  
     Application.ActiveExplorer.WindowState = olMaximized  
    End Sub

    Finally, see Getting Started with VBA in Outlook .

     
    • Proposed as answer by David_JunFeng Monday, December 7, 2015 1:04 AM
    • Marked as answer by David_JunFeng Monday, December 7, 2015 3:11 PM
    Monday, November 30, 2015 1:19 PM

All replies

  • Sure. The Display method of the ContactItem class displays a new Inspector object for the item.

    You may consider handling the Startup  event of the Application class which is fired when Microsoft Outlook is starting, but after all add-in programs have been loaded. For example:

    Private Sub Application_Startup()  
     MsgBox "Welcome, " & Application.GetNamespace("MAPI").CurrentUser  
     Application.ActiveExplorer.WindowState = olMaximized  
    End Sub

    Finally, see Getting Started with VBA in Outlook .

     
    • Proposed as answer by David_JunFeng Monday, December 7, 2015 1:04 AM
    • Marked as answer by David_JunFeng Monday, December 7, 2015 3:11 PM
    Monday, November 30, 2015 1:19 PM
  • >>>Is there a way to open a certain contact at startup in Outlook 2013?

    Yes, I suggest thatn you could use the Application_Startup event in ThisOutlookSession, then refer to below codes:

    Private Sub Application_Startup()
     GetContact
    End Sub
    
    Public Sub GetContact()
        Dim Session As Outlook.NameSpace
        Dim Report As String
        Dim ContactFolder As Outlook.Folder
        Dim currentItem As Object
        Dim currentContact As ContactItem
        
        Set Session = Application.Session
        
        Set ContactFolder = Session.GetDefaultFolder(olFolderContacts)
        
        For Each currentItem In ContactFolder.Items
            If (currentItem.Class = olContact) Then
                Set currentContact = currentItem
                'your special contact 
                If (currentContact.FullName = "Greg Thatcher") Then
                   currentContact.Display
                End If
            End If
       Next
    End Sub
    

    Tuesday, December 1, 2015 4:31 AM
  • Hi ...

    Thank you, Eugene Astafiev ... that did it.


    mvh/regards Øyvind Granberg 6391 Tresfjord Norway

    Saturday, December 5, 2015 12:50 PM