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:
Dim olApp As New Outlook.Application Dim olRoot As Outlook.MAPIFolder Dim olFolder As Outlook.MAPIFolder Dim olMedContactsFolder As Outlook.MAPIFolder = Nothing Dim bFound As Boolean olApp = GetObject(, "Outlook.Application") olRoot = olApp.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox).Parent ' Find the _Medical Contacts folder For Each olFolder In olRoot.Folders If olFolder.Name = "_Medical Contacts" Then olMedContactsFolder = olFolder bFound = True Exit For End If Next ' If the _Medical Contacts folder does not exist, create it If Not bFound Then olMedContactsFolder = olRoot.Folders.Add("_Medical Contacts", Outlook.OlDefaultFolders.olFolderContacts) End If




Reply With Quote