Results 1 to 5 of 5

Thread: [RESOLVED] Outlook Contact List NOT showing in Word

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    Resolved [RESOLVED] Outlook Contact List NOT showing in Word

    Word offers the ability to create an Envelope based off of a contact in Outlook. If I go into Outlook and create a new contact list, it will show up in Word. (Sometimes you have to exit Word for it to show up) However, if I programatically create it via VB 2005, it doesn't show up as an option in Word.

    How do I make this Contact List show up in Word?

    PS - This is on Office 2007. I haven't tested it on other versions.


    vb Code:
    1. Dim olApp As New Outlook.Application
    2.     Dim olRoot As Outlook.MAPIFolder
    3.     Dim olFolder As Outlook.MAPIFolder
    4.     Dim olMedContactsFolder As Outlook.MAPIFolder = Nothing
    5.     Dim bFound As Boolean
    6.  
    7.     olApp = GetObject(, "Outlook.Application")
    8.  
    9.     olRoot = olApp.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox).Parent
    10.  
    11.     ' Find the _Medical Contacts folder
    12.     For Each olFolder In olRoot.Folders
    13.         If olFolder.Name = "_Medical Contacts" Then
    14.             olMedContactsFolder = olFolder
    15.             bFound = True
    16.             Exit For
    17.         End If
    18.     Next
    19.  
    20.     ' If the _Medical Contacts folder does not exist, create it
    21.     If Not bFound Then
    22.         olMedContactsFolder = olRoot.Folders.Add("_Medical Contacts", Outlook.OlDefaultFolders.olFolderContacts)
    23.     End If
    My.Settings.Signature = String.Empty

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    May 2003
    Posts
    758

    Re: Outlook Contact List NOT showing in Word

    Nothing like finding the answer just after you post a question.

    For those who are interrested, after creating a contact list programatically, there is a property ShowAsOutlookAB of the MAPIFolder object that should be set to True if you want it available in Word, etc.
    My.Settings.Signature = String.Empty

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

    Re: [RESOLVED] Outlook Contact List NOT showing in Word

    So you are saying that the new contact folder is not showing up or its associated contacts?
    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 2003
    Posts
    758

    Re: [RESOLVED] Outlook Contact List NOT showing in Word

    The entire contact list does not show up as an option in Outlook without setting that property to True.
    My.Settings.Signature = String.Empty

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

    Re: [RESOLVED] Outlook Contact List NOT showing in Word

    Yes, that is how it needs to be done to have a contact folder show up in the addressbook (although it doesnt really look like an address book but a contact list)
    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

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