We do this using the AddMembers method of the DistListItem class. My tests against Outlook 2010 show that you can pass an msg file as a template too.Īfter we created a new distribution list we need to add some recipients to it. The method accepts a string representing file path to the Outlook template (.oft) as a parameter. In one of my previous articles I described how to create a message based on a template. The Application class has the CreateItemFromTemplate method for this task. We can use a template for creating a new distribution list. A newly created distribution list is always created in the default Contacts folder regardless of the Items collection we use (frankly speaking, the collection may come from any folder).ģ. The Items class provides the Add method which does the job. This method accepts a constant from the OlItemType enumeration and returns a newly created distribution list.Ģ. The simplest way is to use the CreateItem method of the Application class. The similar steps are used for creating distribution list items in Outlook:ġ. Some time ago we discussed how to create a new contact item programmatically. The process of creating Outlook distribution lists is fairly simple. They are available to everyone connected to the Exchange server. If you use an Exchange server in the profile, the Global Address List can contain global distribution lists. Note, you can send them to others if needed. Distribution lists are stored in the Contacts folder too (I mean personal distribution lists). There is no difference between creating a single contact item or a distribution list item. Let’s consider in depth how to create a distribution list in your profile programmatically with VSTO and Add-in Express for Office and. Using distribution lists users can set the TO, CC and BCC fields and send e-mails as they normally do. The distribution list represents a group of contacts that are related in some way. The Outlook Object Model provides the DistListItem class exactly for this task. Sometimes Outlook users need to send their e-mails to the same recipients.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |