Is 'User Field 1' safe to use?

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Hello,

I am considering initializing 'User Field 1' to tag Contact items of
interest with a signature string (unique to each Contact item) that I
can use with colContactItems.Find(strSignature) to easily locate and
display an existing Contact item.

It's simple, and it works. But is it safe? Or will I collide with
other Add-Ins installed by my customers that make use of the same
'User Field 1' for their own purposes?

Thanks.

Jim
 
Hello Tom,

Thanks, that's good information.

I am also looking into using UserProperties, which appears to work
well and is easier to get working (prototype code below) than I had
anticipated. With UserProperties, I am unlikely to collide with some
other third-party Add-In.

Are there any considerations that should give me pause before I go
this route? Will I run into security issues, popups, etc.? I am
developing for non-Exchange environments going back to Outlook 2000.
If I use UserProperties and my customer is an Exchange site, will I
run into any issues?

Thanks.

Jim

Public Sub PopContact(strName As String, strNumber As String)

On Error Resume Next

Dim strKeyName As String
Dim strKeyNumber As String
Dim strFilter As String

strKeyName = "MyKeyName"
strKeyNumber = "MyKeyNumber"

strFilter = "[" & strKeyName & "] = """ & strName & """ And " & _
"[" & strKeyNumber & "] = """ & strNumber & """"

Dim objContact As Outlook.ContactItem

If Not colContactItems Is Nothing Then
Set objContact = colContactItems.Find(strFilter)
If objContact Is Nothing Then
'Existing Contact not found. Create new Contact.
Set objContact = objOutlook.CreateItem(olContactItem)
If Not objContact Is Nothing Then
'Initialize name and number visible to user.
objContact.FullName = strName
objContact.BusinessTelephoneNumber = strNumber
'Create user properties for finding Contact by filter.
objContact.UserProperties.Add( _
strKeyName, olText, True).Value = strName
objContact.UserProperties.Add( _
strKeyNumber, olText, True).Value = strNumber
'Open an Inspector and display the new Contact.
objContact.Display
End If
Else
'Existing Contact found. Display it.
objContact.Display
End If
Set objContact = Nothing
End If
End Sub
 
Back
Top