A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Add value to public contacts



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5  
Old April 28th 08, 01:46 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Add value to public contacts

You need to call objContact.Save to make the change permanent.

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


"Lp12" wrote in message ...
An Update,
I succeed in running the below code but when I look @ the contact list
afterwards I still see a blank "Company" property. How come?
thanks a lot

Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")

Set colContacts = objNamespace.GetDefaultFolder(olFolderContacts).It ems
For Each objContact In colContacts
objContact.CompanyName = "LADIDA LTD"
Next


"Lp12" wrote:

Thanks a lot Michael,
Here is the code I'm trying to run (I'm a newbie in Outlook programming):
Sub EditContacts()
Set myNameSpace = Application.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderContacts).ite ms
Set myNewFolder = myFolder.Folders("Private Contacts")
Set MyItems = myNewFolder
For Each myitem In MyItems
CompanyName = "LADIDA LTD"
Next
End Sub

I'm getting error on third row and can't get past it.
Any thoughts?
Thanks again

"Michael Bauer [MVP - Outlook]" wrote:



If there's something common to all of the employees you can use teh Restrict
function to get that collection. Then loop though it and change the Company
property.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool:
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Sun, 27 Apr 2008 06:37:00 -0700 schrieb Lp12:

Hi All,
I have to add my company name (under company field) to all employees
contacts (public folder).
What is the best practice to do so?
Thanks a lot

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
copy contacts from public folder to outlook contacts list David Goldberg Outlook - Using Contacts 1 September 25th 07 01:50 AM
How to share outlook 2003 customize contacts or contacts subfolder without do it on public folder? Sue Mosher [MVP-Outlook] Outlook - Using Contacts 4 June 28th 07 10:45 PM
Moving public contacts e-mail to public journal with rule mbn Outlook - Using Contacts 2 May 18th 07 05:59 PM
Can I combine shared contacts and make a public folder of contacts Nicole Outlook - Using Contacts 4 August 10th 06 04:36 PM
Making the Public Folder Contacts the Primary Contacts?? Roman B. Outlook - Using Contacts 1 January 9th 06 10:52 AM


All times are GMT +1. The time now is 11:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.