Results 1 to 6 of 6

Thread: Public Folders EntryID

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Public Folders EntryID

    Is it possible to know the EntryID of a Public Folders for contacts in Exchange without using the PickFolder method?

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Public Folders EntryID

    You can navigate down the folder structure to your destination public folder. Then get its .EntryID value.
    This value does not ever change unless the folder is deleted and recreated.

    Is the destination folder dynamic or will it be in the same location all the time?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Public Folders EntryID

    Just in case, here is a demo to transversing the Public folders to a folder called "Development".
    VB Code:
    1. Option Explicit
    2. 'Add a reference to MS Outlook xx.0 Object Library
    3. Private Sub Command1_Click()
    4.     Dim oApp As Outlook.Application
    5.     Dim oNS As Outlook.NameSpace
    6.     Dim oPublicFolders As Outlook.MAPIFolder
    7.     Dim oAllPublicFolders As Outlook.MAPIFolder
    8.     Dim oFolder As Outlook.MAPIFolder
    9.     Dim sEntryID As String
    10.     Set oApp = New Outlook.Application
    11.     Set oNS = oApp.GetNamespace("MAPI")
    12.     Set oPublicFolders = oNS.Folders("Public Folders")
    13.     Set oAllPublicFolders = oPublicFolders.Folders("All Public Folders")
    14.     Set oFolder = oAllPublicFolders.Folders("Development")
    15.     sEntryID = oFolder.EntryID
    16.     Debug.Print sEntryID
    17.     Set oFolder = Nothing
    18.     Set oAllPublicFolders = Nothing
    19.     Set oPublicFolders = Nothing
    20.     Set oNS = Nothing
    21.     Set oApp = Nothing
    22. End Sub
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Re: Public Folders EntryID

    Is it normal that this code is working on Outlook 2002 with Windows XP and not on Outlook 2002 with Windows 2000?

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Public Folders EntryID

    What error are you getting?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    May 2004
    Location
    Granby, Qc, Canada
    Posts
    602

    Re: Public Folders EntryID

    The operation failed. An object could not be found.

    The error occurs on this line :

    VB Code:
    1. Set oPublicFolders = oNS.Folders("Public Folders")

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