确保通讯组列表中的联系人同时显示姓名和电子邮件地址
如何确保添加到 Outlook 通讯组列表的联系人同时显示姓名和电子邮件地址?这些联系人可能不存在于任何其他地址簿中,仅存在于通讯组列表中。目前,它们仅显示为电子邮件地址(在两列中)。
替代文本 http://img52.imageshack.us/img52/1804/tempgg.jpg< /a>
我们使用的 VBA 大致如下:
Do Until RS.EOF
//here's where we want to inject RS!FirstName, RS!Surname etc
objRecipients.Add RS!Email
objRecipients.Resolve
RS.MoveNext
Loop
Set objDistList = contactsFolder.Items.Add("IPM.DistList")
objDistList.DLName = "Whatever"
objDistList.AddMembers objRecipients
objDistList.Save
etc
How can I ensure the contacts I add to an Outlook distribution list are displayed with both name and email address? These contacts may not exist in any other address book, just the distribution list. Currently they show up just as an email address (in both columns).
alt text http://img52.imageshack.us/img52/1804/tempgg.jpg
Here's roughly the VBA we're using:
Do Until RS.EOF
//here's where we want to inject RS!FirstName, RS!Surname etc
objRecipients.Add RS!Email
objRecipients.Resolve
RS.MoveNext
Loop
Set objDistList = contactsFolder.Items.Add("IPM.DistList")
objDistList.DLName = "Whatever"
objDistList.AddMembers objRecipients
objDistList.Save
etc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您必须为每个收件人创建一个 ContactItem,以便您可以定义名称。这是一个例子:
I think you have to create a ContactItem for each recipient so you can define the name. Here's an example:
感谢 Dick Kusleika 的回答,但 Graeme 的回答给出了我的想法可能有一种更简单的方法。
这只是在通讯组列表的条目中使用尖括号。如
“Ringo Starr[电子邮件受保护]>"
效果很好。
所以我原来的例子看起来像这样:
Thanks to Dick Kusleika for his answer but Graeme's answer here gave me an idea there could be an easier way.
And that is just to use angle brackets in the entry to the distribution list. As in
"Ringo Starr<[email protected]>"
Which works just fine.
So my original example would look like this: