Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 75
Default Save contact to a particular folder in Outlook

I need some help! I have the VBA code going together ok. Im sure like most
of you every time the code is done someone always say: Gee I wish it could€¦€
Inevitably, the manager likes the idea and thus new work is created for us
poor slobs. Unfortunately, Im not a computer programmer, Im an Engineer,
can you hear Bones talking to Kirk?

Ok, the problem. I have this VBA code Ive been working on for a couple
weeks. We use Excel 2003. Our contacts, which we keep in Excel, change
daily. 1st exercise was to create a macro to update Outlook contacts when a
new one can in. I thought the code was done, but no! The 2nd change was to
give the user the option to delete the old one. I thought Im done again,
but no!! Well now they want me to be able to send the contact to a subfolder
under Contacts in Outlook. Ther folder will be called "Lazy" in honor of my
co-workers. Anyway, Ive 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("contacts1 ")
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("C ontacts1")

Im sure this is simple for you guys, but my hairline is almost gone! Any
help would be appreciated!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook contact linked to name in Excel bdesaul Excel Discussion (Misc queries) 2 January 28th 07 11:04 PM
Push Button in Outlook to Change Focus to Outlook Contact List Cole Excel Programming 0 October 25th 06 11:29 PM
Save file in a new folder, but create folder only if folder doesn't already exist? nbaj2k[_40_] Excel Programming 6 August 11th 06 08:41 PM
open outlook contact Martin Excel Discussion (Misc queries) 0 May 4th 05 05:48 PM
Outlook Contact Info Rick Slaugh Excel Programming 1 October 15th 03 04:37 PM


All times are GMT +1. The time now is 08:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"