Outlook 2007 default object behavior, Question ?

  • Thread starter Thread starter Harold Little
  • Start date Start date
H

Harold Little

The Contacts folder is currently selected with an ContactItem selected
within that view.
Using code in a outlook module as below.

Set oObj = ActiveExplorer.Selection(1)
If typename(oObj) = "ContactItem" then
sName = oObj
End if

Prior to Outlook 2k7, If the Firstname and Lastname fields contain data the
above code would return the Fullname now I get Lastname, Firstname ?
What am I missing here.
 
It's probably due to the setting for FileAs. I don't think it's Outlook 2007
specific.
 
I have compared my Addresslist sort order and Contact Options,
verified the Default Fullname and Default FileAs matches my XP - Olk2k3
settings,
still the Vista-Olk2k7 does not return the firstname lastname based on
object's default.
 
PMJI with maybe a dumb question, but if you want the FullName, why don't you specifically return that property value rather than relying on the default property of the object?

Also, if Outlook is returning the FileAs value, as Ken suspects, all those options you looked at are probably irrelevant. What I would expect to be the determining factor is what's stored in the actual item. (And it could be the Subject property, not FileAs, that's being used.)

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


Little said:
I have compared my Addresslist sort order and Contact Options,
verified the Default Fullname and Default FileAs matches my XP - Olk2k3
settings,
still the Vista-Olk2k7 does not return the firstname lastname based on
object's default.

Ken Slovak - said:
It's probably due to the setting for FileAs. I don't think it's Outlook
2007 specific.

--
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


Harold Little said:
The Contacts folder is currently selected with an ContactItem selected
within that view.
Using code in a outlook module as below.

Set oObj = ActiveExplorer.Selection(1)
If typename(oObj) = "ContactItem" then
sName = oObj
End if

Prior to Outlook 2k7, If the Firstname and Lastname fields contain data
the above code would return the Fullname now I get Lastname, Firstname ?
What am I missing here.
 
The Object Browser doesn't indicate any default property for a contact item.

It looks like Subject is being supplied in Outlook 2003 and FileAs in
Outlook 2007. However, as Sue says why depend on an undocumented implicit
default property that might change from version to version and not use an
explicit property that you want. If you want FullName then ask for it.




PMJI with maybe a dumb question, but if you want the FullName, why don't you
specifically return that property value rather than relying on the default
property of the object?

Also, if Outlook is returning the FileAs value, as Ken suspects, all those
options you looked at are probably irrelevant. What I would expect to be the
determining factor is what's stored in the actual item. (And it could be the
Subject property, not FileAs, that's being used.)
 
Back
Top