473,387 Members | 1,455 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Create a Contact in Outlook from Access

1
The following code opens a new contact in Outlook and populates the fields with the data from my Access database.

How do I change the the default folder that this contact is saved to, at the moment it saves it to the default folder 'Contacts'? I want it to save these contacts in a folder called 'Agents'

================================================== ====

Public Function fncAddToOutlook()
On Error GoTo StartError

Dim objOutlook As Outlook.Application
Dim objItem As Object

Set objOutlook = CreateObject("Outlook.Application")
Set objItem = objOutlook.CreateItem(olContactItem)

With objItem
.FullName = Me.Contact
.Email1Address = Me.Email
.CompanyName = Me.Agent
.BusinessAddress = Me.Address1 & vbCrLf & Me.Address2 & vbCrLf & Me.Address3
.BusinessAddressCity = Me.Town
.BusinessAddressPostalCode = Me.PostCode
.BusinessFaxNumber = Me.FaxNo
.BusinessTelephoneNumber = Me.TelNo
.BusinessHomePage = Me.Web
.MobileTelephoneNumber = Me.MobNo
.Categories = "Agent"
End With

objItem.Display


Set objOutlook = Nothing

Exit Function

StartError:
MsgBox "Error: " & Err & " " & Error
Exit Function
End Function

================================================== ======

Many thanks

Jarmin
Sep 30 '06 #1
1 5569
PEB
1,418 Expert 1GB
Hi Jarmin,

Maybe if you transfer your file with contacts in the respective folder? But this isn't thing that you may change easily from Access...

I mean maybe this involves a change of registry keys for this file...

Best regards

:)
Sep 30 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Jerry | last post by:
I am trying to create a contact using CDO 1.21. I was wondering if anyone had any sample code of how they may have done this. I am having trouble findinf documentation on how this is done. I...
3
by: scott | last post by:
Anyone have a link to syntax that could create an outlook vcard file format? all examples i find are for doing it inside outlook with .net. i'm just looking for an ASP solution.
20
by: wolftor | last post by:
Would anyone be willing to beta test my application for me and give me some feedback? I can give you feedback in exchange (ie. if there are parts you're interested in knowing how it was done) or I...
2
by: Chen | last post by:
Are there any sample code for access Contact items in public folder of Outlook from VB.NET Thanks
2
by: charliej2001 | last post by:
Hi all Im copying details from an Outlook contact address book into an Access database. Originally I was only copying about 10 fields across, using the the following method, with a line of code...
1
by: jikdur | last post by:
Overview: I have a form screen where users input criteria into different text boxes to limit a contact table. This is then fed into a query that limits the list returned. The returned list is in a...
1
by: kannan | last post by:
Hi, I am trying to loop through outlook contact address and display in messagebox. I have used following code: Outlook._Application olApp = new Outlook.ApplicationClass(); Outlook._NameSpace...
0
by: Lauren Quantrell | last post by:
I'm using the code below to export an Access 2K contact to Outlook 2K. It works fine as long as Outlook is running, however, I get an error is Outlook is closed. The error is: Method 'Save' of...
1
by: philmarsay | last post by:
I have some code that loops through all contacts in a contact folder (approx 3000), reads some details from each contact and uses that information to perform various functions. However, as the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.