Is 'User Field 1' safe to use?

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
 
J

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top