Access2000 to Outlook2000 folders

I am attempting to send data from an Access Application to a subfolder in Contacts. How do I address a subfolder which is under the Contacts folder. Ie I have three types of contacts, Banks, Agents and Councils. Each has its own subfolder in Outlook under Contacts. Every attempt to write to these subfolders have all resulted in all data ending up in the main Contacts folder. I am suspicios this connot be done. If so is there another way. Can I send data from Access to a folder on the same level as Contacts without having to make it the default contacts folder?I do not want to enter Outlook, change the defauly folder everytime I need to send data from my Access Application. I am not using the exchange Server..just Windows98

baggshAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

celticsCommented:
You are not going to like it but here is an article from Microsoft stating that by contacts are automatically placed in the default contacts folder : http://support.microsoft.com/support/kb/articles/Q208/2/32.ASP
0
baggshAuthor Commented:
Then is there progamatically a way of changing the default folder , writing the data, then changing back the default folder to the original folder?
0
jhanaCommented:
Celtics is only partially correct, using the standard import/export routine you can only import to the default Contacts folder.

But, you can do what you describe using VB. Please post the VB code you are presently using to post from Access to Outlook.

Thanks,
Jhana
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

mohnshineCommented:
If you are using the standard contact item, then the following code should be approximately what you need to add contacts to your subfolders.

' Default Contacts Folder
Set DContacts = Application.GetNameSpace("MAPI").GetDefaultFolder(10)

' Banks Subfolder under contacts
Set BanksFld = DContacts.Folders("Banks")

' Add item to subfolder
Set AddBank = BankFld.Add("IPM.Contact")
0
baggshAuthor Commented:
JHana

here's the code as presently exists which writes to Contacts as the default folder. What we really need is to be able to write to Banks (say) as the subfolder of Contacts.

Dim out As Outlook.Application
 Dim calTask As Outlook.ContactItem
 
 Set out = New Outlook.Application
 Set calTask = out.CreateItem(olContactItem)

 With calTask
 
   .CompanyName = Me!Name
   .BusinessAddressStreet = Me!Street
   .BusinessAddressCity = Me!City
 
   If IsNull(Me!Phone) Then
    .BusinessTelephoneNumber = " "
   Else
   .BusinessTelephoneNumber = Me!Phone
   End If
   If IsNull(Me!Fax) Then
     .BusinessFaxNumber = " "
   Else
   .BusinessFaxNumber = Me!Fax
   End If
   If IsNull(Me!Email) Then
    .Email1Address = " "
    Else
    .Email1Address = Me!Email
    End If
    .NickName = Me!Sal
   .Save
  End With


I would be very pleased to receive any comments from anyone who can do this!!!

0
jhanaCommented:
Here you go... FYI, it can be modified to reference Exchange Public Folders as well...

 Dim out As Outlook.Application
 Dim calTask As Outlook.ContactItem
 Dim nms As Outlook.NameSpace
 Dim pFolder As Object
 Dim plFolder As Object
 Dim itms As Object
 Dim itm As Object

 Set out = CreateObject("Outlook.Application")
 Set nms = out.GetNamespace("MAPI")
 Set pFolder = nms.GetDefaultFolder(olFolderContacts)
 Set plFolder = pFolder.Folders("Sound")
 Set itms = plFolder.Items
 ' You may substitute a custom form for the standard Contact form here.
 Set calTask = itms.Add("IPM.Contact")


 With calTask
   
   .CompanyName = Me!Name
   .BusinessAddressStreet = Me!Street
   .BusinessAddressCity = Me!City
   
   If IsNull(Me!Phone) Then
    .BusinessTelephoneNumber = " "
   Else
   .BusinessTelephoneNumber = Me!Phone
   End If
   If IsNull(Me!Fax) Then
     .BusinessFaxNumber = " "
   Else
   .BusinessFaxNumber = Me!Fax
   End If
   If IsNull(Me!Email) Then
    .Email1Address = " "
    Else
    .Email1Address = Me!Email
    End If
    .NickName = Me!Sal
   .Save
  End With


Good Luck!
Jhana
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
baggshAuthor Commented:
Where exactly is the reference to Contacts\Bank ie where do I insert the three seperate subfolders that I have (Banks, Conveyancers or Councils?)
0
jhanaCommented:
So sorry, I forgot to change the name, it is the second line... just substitute the name of your subfolder for "Sound". The first line references the "Contacts" folder.

"Contacts" folder
  Set pFolder = nms.GetDefaultFolder olFolderContacts)
 Set plFolder = pFolder.Folders("Sound")

Good luck,
Jhana
0
baggshAuthor Commented:
Thankyou for your wonderful help. I have it now all working. I am going to post another question about Exchange Servers....maybe you can help me with that. I use win98 and by sharing the pst file has certain drawbacks on a small office network (4 computers). I wonder what my next step will be. How can I address this question for you so that you get the points!
0
jhanaCommented:
Points aren't the point ;-) it's helping someone solve a problem :-) Just post your question and I'm sure one of EE's experts will be able to help.

Thanks,
Jhana
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Outlook

From novice to tech pro — start learning today.