|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Retrieving 'Alias' field value using Outlook 2003 VBAHello,
I am trying to retrieve an AddressEntry object from an AddressEntries collection by passing the value in the 'Alias' field on the Address Property window - using Outlook 2003 & VBA. I could retrieve the AddressEntry object by passing the Display Name value as follows: objOutlookAddressEntry = objOutlookAddressEntries.Item(strDispName) I was able to retrieve the AddressEntry object here since Item() takes the index or the 'default property' of the object, and Display Name seems to be the default property of the AddressEntry object. But I need to retrieve the AddressEntry by passing the value in the 'Alias' field. Any help greatly appreciated! Thanks! There is no Alias property for an AddressEntry object.
If by alias you mean something like "Ken Slovak" has the alias of "kens" then you need to create a Recipient object using the alias and retrieve the AddressEntry property of the Recipient object to get what you want. -- Show quoteKen Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007 Reminder Manager, Extended Reminders, Attachment Options http://www.slovaktech.com/products.htm "Ajith" <Aj***@discussions.microsoft.com> wrote in message news:46ABA12B-DC59-4815-ADC0-CE13034DCED4@microsoft.com... > Hello, > > I am trying to retrieve an AddressEntry object from an AddressEntries > collection by passing the value in the 'Alias' field on the Address > Property > window - using Outlook 2003 & VBA. I could retrieve the AddressEntry > object > by passing the Display Name value as follows: > objOutlookAddressEntry = objOutlookAddressEntries.Item(strDispName) > I was able to retrieve the AddressEntry object here since Item() takes the > index or the 'default property' of the object, and Display Name seems to > be > the default property of the AddressEntry object. > > But I need to retrieve the AddressEntry by passing the value in the > 'Alias' > field. > > Any help greatly appreciated! > > Thanks! Ken,
Thank you so much for your response. I see some light now :-) Could you please tell me how to create a Recipient object using the Alias? I searched in MSDN and I found this: --------------------------------------------- Add method as it applies to the Recipients object. Creates a new recipient in the Recipients collection and returns the new recipient as a Recipient object. expression.Add(Name) expression Required. An expression that returns a Recipients collection object. Name Required String. The display name of the recipient. --------------------------------------------- So I'm wondering how to create a Recipient object by using the Alias ...??? Thanks again! Show quote "Ken Slovak - [MVP - Outlook]" wrote: > There is no Alias property for an AddressEntry object. > > If by alias you mean something like "Ken Slovak" has the alias of "kens" > then you need to create a Recipient object using the alias and retrieve the > AddressEntry property of the Recipient object to get what you want. > > -- > Ken Slovak > [MVP - Outlook] > http://www.slovaktech.com > Author: Professional Programming Outlook 2007 > Reminder Manager, Extended Reminders, Attachment Options > http://www.slovaktech.com/products.htm > > > "Ajith" <Aj***@discussions.microsoft.com> wrote in message > news:46ABA12B-DC59-4815-ADC0-CE13034DCED4@microsoft.com... > > Hello, > > > > I am trying to retrieve an AddressEntry object from an AddressEntries > > collection by passing the value in the 'Alias' field on the Address > > Property > > window - using Outlook 2003 & VBA. I could retrieve the AddressEntry > > object > > by passing the Display Name value as follows: > > objOutlookAddressEntry = objOutlookAddressEntries.Item(strDispName) > > I was able to retrieve the AddressEntry object here since Item() takes the > > index or the 'default property' of the object, and Display Name seems to > > be > > the default property of the AddressEntry object. > > > > But I need to retrieve the AddressEntry by passing the value in the > > 'Alias' > > field. > > > > Any help greatly appreciated! > > > > Thanks! > > Ken,
I found CreateRecipient method, even that takes Display Name. -------------------------------------------------------- expression.CreateRecipient(RecipientName) expression Required. An expression that returns a NameSpace object. RecipientName Required String. The display name of the recipient. ------------------------------------------------------------------------------------ It doesn't talk about using any other data/field to create the object. Thanks! Show quote "Ken Slovak - [MVP - Outlook]" wrote: > There is no Alias property for an AddressEntry object. > > If by alias you mean something like "Ken Slovak" has the alias of "kens" > then you need to create a Recipient object using the alias and retrieve the > AddressEntry property of the Recipient object to get what you want. > > -- > Ken Slovak > [MVP - Outlook] > http://www.slovaktech.com > Author: Professional Programming Outlook 2007 > Reminder Manager, Extended Reminders, Attachment Options > http://www.slovaktech.com/products.htm > > > "Ajith" <Aj***@discussions.microsoft.com> wrote in message > news:46ABA12B-DC59-4815-ADC0-CE13034DCED4@microsoft.com... > > Hello, > > > > I am trying to retrieve an AddressEntry object from an AddressEntries > > collection by passing the value in the 'Alias' field on the Address > > Property > > window - using Outlook 2003 & VBA. I could retrieve the AddressEntry > > object > > by passing the Display Name value as follows: > > objOutlookAddressEntry = objOutlookAddressEntries.Item(strDispName) > > I was able to retrieve the AddressEntry object here since Item() takes the > > index or the 'default property' of the object, and Display Name seems to > > be > > the default property of the AddressEntry object. > > > > But I need to retrieve the AddressEntry by passing the value in the > > 'Alias' > > field. > > > > Any help greatly appreciated! > > > > Thanks! > > Ken,
I passed Alias in the CreateRecipient method and it worked just fine!!!! :-) Thank you so much for your tip!! Show quote "Ken Slovak - [MVP - Outlook]" wrote: > There is no Alias property for an AddressEntry object. > > If by alias you mean something like "Ken Slovak" has the alias of "kens" > then you need to create a Recipient object using the alias and retrieve the > AddressEntry property of the Recipient object to get what you want. > > -- > Ken Slovak > [MVP - Outlook] > http://www.slovaktech.com > Author: Professional Programming Outlook 2007 > Reminder Manager, Extended Reminders, Attachment Options > http://www.slovaktech.com/products.htm > > > "Ajith" <Aj***@discussions.microsoft.com> wrote in message > news:46ABA12B-DC59-4815-ADC0-CE13034DCED4@microsoft.com... > > Hello, > > > > I am trying to retrieve an AddressEntry object from an AddressEntries > > collection by passing the value in the 'Alias' field on the Address > > Property > > window - using Outlook 2003 & VBA. I could retrieve the AddressEntry > > object > > by passing the Display Name value as follows: > > objOutlookAddressEntry = objOutlookAddressEntries.Item(strDispName) > > I was able to retrieve the AddressEntry object here since Item() takes the > > index or the 'default property' of the object, and Display Name seems to > > be > > the default property of the AddressEntry object. > > > > But I need to retrieve the AddressEntry by passing the value in the > > 'Alias' > > field. > > > > Any help greatly appreciated! > > > > Thanks! > > |
|||||||||||||||||||||||