![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hello-
I need to move the phone numbers from the 'company' field to the 'business' field for approximately 800 contacts. not all contacts have a number in the 'company' field. the company field should be blank after the move. please help. Thanks, Tyson |
Ads |
#2
|
|||
|
|||
![]()
Am Thu, 8 Jun 2006 19:27:01 -0700 schrieb Tyson:
Tyson, this sample should do it: Public Sub ExportContactsAsVCard() Dim obj As Object Dim Contact as Outlook.ContactItem Dim Items As Outlook.Items Set Items = Application.Session.GetDefaultFolder(olFolderConta cts).Items For Each obj In Items If TypeOf obj Is Outlook.ContactItem Then Set Contact=obj Contact.BusinessTelephoneNumber=Contact.CompanyMai nTelephoneNumber Contact.CompanyMainTelephoneNumber=vbNullString Contact.Save End If Next End Sub -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- Hello- I need to move the phone numbers from the 'company' field to the 'business' field for approximately 800 contacts. not all contacts have a number in the 'company' field. the company field should be blank after the move. please help. Thanks, Tyson |
#3
|
|||
|
|||
![]()
Michael-
Thanks for the code. Unfortunately, I forgot to mention that some contacts already have a number in the 'business phone' field - this code overwrites those numbers when the 'company phone' field is blank. How to check for that before overwriting? Tyson "Michael Bauer" wrote: Am Thu, 8 Jun 2006 19:27:01 -0700 schrieb Tyson: Tyson, this sample should do it: Public Sub ExportContactsAsVCard() Dim obj As Object Dim Contact as Outlook.ContactItem Dim Items As Outlook.Items Set Items = Application.Session.GetDefaultFolder(olFolderConta cts).Items For Each obj In Items If TypeOf obj Is Outlook.ContactItem Then Set Contact=obj Contact.BusinessTelephoneNumber=Contact.CompanyMai nTelephoneNumber Contact.CompanyMainTelephoneNumber=vbNullString Contact.Save End If Next End Sub -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.vbOffice.net -- Hello- I need to move the phone numbers from the 'company' field to the 'business' field for approximately 800 contacts. not all contacts have a number in the 'company' field. the company field should be blank after the move. please help. Thanks, Tyson |
#4
|
|||
|
|||
![]()
Tyson wrote:
How to check for that before overwriting? Use the Len function to see if the field contains data. -mhd |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
change format of phone field from text to phone | Jim | Outlook - Using Contacts | 1 | May 19th 06 01:29 AM |
Include a field for a business card image in outlook(any size/sid | Prieto Chulo | Outlook - Using Forms | 0 | May 13th 06 11:57 PM |
how do i format phone number field | tnbubba | Outlook - General Queries | 1 | May 1st 06 04:04 PM |
LDAP and missing field company name | Kathy | Outlook - Using Contacts | 0 | February 1st 06 06:34 AM |
Populate Company field from Contact field in custom task form | Sue Mosher [MVP-Outlook] | Outlook - Using Forms | 0 | January 20th 06 07:37 PM |