Results 1 to 4 of 4

Thread: Need to Extract information from Microsoft outlook basis given employee ID's usingVBA

  1. #1
    Junior Member
    Join Date
    Apr 2015
    Posts
    1
    Rep Power
    0
    Last edited by DocAElstein; 09-22-2023 at 05:23 PM.

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    Kush, what exactly do you need to extract? Can you share a sample and how does using employee ID help to get what you are looking for.
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Senior Member LalitPandey87's Avatar
    Join Date
    Sep 2011
    Posts
    222
    Rep Power
    13
    Try this:

    Code:
    Enum OL_Info
        
        CompanyName = 1
        BusinessAddress = 2
        BusinessAddressCity = 3
        BusinessAddressState = 4
        BusinessAddressPostalCode = 5
        BusinessTelephoneNumber = 6
        Email1Address = 7
        
    End Enum
    
    Function LM_Test(Name As String, Info As OL_Info) As String
    
        Dim olA                 As Object 'Outlook.Application
        Dim olNS                As Object 'Namespace
        Dim olAB                As Object 'MAPIFolder
        Dim lItem               As Long
        Dim sNameWanted         As String
        Dim sRetValue           As String
    
        Set olA = CreateObject("Outlook.Application")
        Set olNS = olA.GetNamespace("MAPI")
        Set olAB = olNS.GetDefaultFolder(olFolderContacts)
    
        Application.Volatile
        sNameWanted = rRng.Value
        sRetValue = "Not Found"
    
        On Error Resume Next
    
        For lItem = 1 To olAB.Items.Count
            With olAB.Items(lItem)
                If sNameWanted = .FullName Then
                    Select Case Info
                        Case 1
                            sRetValue = .CompanyName
                        Case 2
                            sRetValue = .BusinessAddress
                        Case 3
                            sRetValue = .BusinessAddressCity
                        Case 4
                            sRetValue = .BusinessAddressState
                        Case 5
                            sRetValue = .BusinessAddressPostalCode
                        Case 6
                            sRetValue = .BusinessTelephoneNumber
                        Case 7
                            sRetValue = .Email1Address
                    End Select
                End If
            End With
        Next lItem
        olA.Quit
        
        LM_Test = sRetValue
        
        'Release Memory
        Set olA = Nothing
        Set olNS = Nothing
        Set olAB = Nothing
        lItem = Empty
        sNameWanted = vbNullString
        sRetValue = vbNullString
        
    End Function
    Or please check:

    http://www.globaliconnect.com/excel/...=79&Itemid=475
    Last edited by LalitPandey87; 05-13-2015 at 11:39 AM.

  4. #4
    Junior Member
    Join Date
    Apr 2018
    Posts
    1
    Rep Power
    0

    solution

    Okay, if you need to extract information from Microsoft outlook I can suggest you one way, to do it. Speaking from my experience, such call-it improvements could harm the working convenience indeed, as you said so. I tried this and it suited me specificly, but I see that for many other guys it turned their databases to mush. Usually you need to transfer data from one client to another and else, so when I was using winmail in vista and switched to more up-to-dated Outlook 2016 I was a bit confused, but later I found a transfet tool in order to import mail to outlook source Afterwards I was able to easily import all my emails, and it worked out fine for my coworker who switched from OS X Mail Client to that as well. Hope it will come in use for somebody here, in order to keep your data filtered out as it suppose to.

Similar Threads

  1. Extract Outlook 2007 global address List in excel 2007
    By superman in forum Outlook Help
    Replies: 0
    Last Post: 09-03-2014, 07:15 PM
  2. Replies: 4
    Last Post: 07-08-2013, 05:36 PM
  3. Replies: 6
    Last Post: 05-25-2013, 07:36 PM
  4. Replies: 2
    Last Post: 04-10-2013, 12:40 AM
  5. High Lighting Current Date In employee Attendance
    By sanjeevi888 in forum Excel Help
    Replies: 2
    Last Post: 07-01-2012, 10:59 PM

Posting Permissions

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