Outlook Contact Ph # format

G

Guest

Hi! I'm trying to add phone # to Outlook Contact and it works good except
with phone # format is "123-4567". Many different ph# format works fine
(like (999)666-8888, x1234 etc.,)

Error example: Business (323243) 123-4567

strPhone (value shows, 123-4467) - correct value
ciContact.BusinessTelephoneNumber (value shows, (323243) 123-4567) -put junk
in the front

Thanks in advance. codes are below:

Public Sub OpenOutlookContact(strFullName As String, strEmail As String,
strPhone As String)
' Open a Microsoft Outlook contact for the specified name.

Dim appOutlook As New Outlook.Application
Dim nsOutlook As NameSpace
Dim mfContacts As MAPIFolder
Dim ciContact As ContactItem

' Open the Outlook default Contacts folder.
Set nsOutlook = appOutlook.GetNamespace("MAPI")
Set mfContacts = nsOutlook.GetDefaultFolder(olFolderContacts)

' Find the contact named in the AssignedTo column.
Set ciContact = mfContacts.Items.Find("[FullName] = " & strFullName)

' If the contact doesn't exist, create a new contact.
If ciContact Is Nothing Then
Set ciContact = mfContacts.Items.Add
ciContact.FullName = strFullName
ciContact.Email1Address = strEmail
ciContact.BusinessTelephoneNumber = strPhone
End If

' Open the Outlook contact window.
ciContact.Display

End Sub
 
G

Guest

Thanks Arvin.

Arvin Meyer said:
You may want to ask this in an Outlook newsgroup. This newsgroup is devoted
to Microsoft Access databases. You are much more likely to find an answer in
a group devoted to your subject.

Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access

skk said:
Hi! I'm trying to add phone # to Outlook Contact and it works good except
with phone # format is "123-4567". Many different ph# format works fine
(like (999)666-8888, x1234 etc.,)

Error example: Business (323243) 123-4567

strPhone (value shows, 123-4467) - correct value
ciContact.BusinessTelephoneNumber (value shows, (323243) 123-4567) -put junk
in the front

Thanks in advance. codes are below:

Public Sub OpenOutlookContact(strFullName As String, strEmail As String,
strPhone As String)
' Open a Microsoft Outlook contact for the specified name.

Dim appOutlook As New Outlook.Application
Dim nsOutlook As NameSpace
Dim mfContacts As MAPIFolder
Dim ciContact As ContactItem

' Open the Outlook default Contacts folder.
Set nsOutlook = appOutlook.GetNamespace("MAPI")
Set mfContacts = nsOutlook.GetDefaultFolder(olFolderContacts)

' Find the contact named in the AssignedTo column.
Set ciContact = mfContacts.Items.Find("[FullName] = " & strFullName)

' If the contact doesn't exist, create a new contact.
If ciContact Is Nothing Then
Set ciContact = mfContacts.Items.Add
ciContact.FullName = strFullName
ciContact.Email1Address = strEmail
ciContact.BusinessTelephoneNumber = strPhone
End If

' Open the Outlook contact window.
ciContact.Display

End Sub
 
Top