PC Review


Reply
Thread Tools Rate Thread

Create a subfolder in Outlook contacts called delintel

 
 
Mathew
Guest
Posts: n/a
 
      29th Apr 2008
I need some help! I have the VBA code going together ok.
I have this VBA code I’ve been working on for a couple
weeks. We use Excel 2003. We keep our contacts in Excel,
because these change daily. I've been tasked to create a Macro that
will send a new contact to a subfolder under Contacts in Outlook.
The folder will be called "Delintel"
I’ve re-read Automating Outlook with Excel at Dick
Clicks http://www.dicks-clicks.com/excel/olAutomating.htm
very good site. I've some others as well. I have not yet
found a way for saving the contact to a subfolder under
my Contacts in Outlook. How can I access or create this
subfolder? Below is some of the code.

For Each rCell In Range("A4:A580").Cells
Set olApp = CreateObject("Outlook.Application")
If Err.Number = 429 Then
Set olApp = CreateObject("Outlook.application")
End If

Set olCi = olApp.CreateItem(olContactItem)

OrganizationalIDNumber = rCell.Value ' Company long # i.e. AB001..
Department1 = rCell.Offset(0, 1).Value ' Company Short Name
……

With olCi
.AssistantName = AssistantName1 ' Assistants Name
.CompanyName = Company ' Company Name
……
.Save
End With
Set olCi = Nothing
Set olApp = Nothing
Next rCell

I changed the line Set Olci to:
Set olCi = olApp.CreateItem(olContactItem).Folders("delintel")
But I get error 438. So this is not the correct way to access the object.

Among the other attempts I also tried:
Set Fldr = olNs.GetDefaultFolder(olFolderContacts).Folders("delintel")

Any help would be greatly appreciated!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mailmerge with outlook contacts subfolder =?Utf-8?B?V29sZiBMYWR5?= Microsoft Outlook Contacts 1 31st Jul 2007 08:25 PM
Is it possible to create a subfolder for your contacts? =?Utf-8?B?SW5mbw==?= Microsoft Outlook Contacts 1 11th Jul 2007 09:27 PM
How to share outlook 2003 customize contacts or contacts subfolder without do it on public folder? Sue Mosher [MVP-Outlook] Microsoft Outlook Contacts 2 28th Jun 2007 12:32 PM
How to share outlook 2003 customize contacts or contacts subfolder? =?Utf-8?B?VG9tIFdpY2tlcmF0aA==?= Microsoft Access 1 1st Apr 2007 04:15 AM
Create subfolder under Business Contacts =?Utf-8?B?Q3JhaWc=?= Microsoft Outlook BCM 2 25th Feb 2005 12:44 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:29 PM.