PDA

Click to See Complete Forum and Search --> : Accessing Outlook using VB


lingling
Jun 15th, 2001, 07:58 PM
Hi,
I need some help on the Outlook. As I was only a beginner on VB, so i was lost. Please Help me... Pls..... =)

I need to update info like contacts , calender retrieve from DB and update to the user's ms outlook.

I have to let the user access thru the Net so i was required to use ActiveX.
I can retrieve the data frm DB using ActiveX but i don't know how to update to the Outlook.

i know need to use Outlook.Application..... but i was helpless coz i don't know how to use....

so Can u help??
Really appreciate it... =)

Lethal
Jun 16th, 2001, 09:44 PM
This will add an item to your contact list:


Option Explicit
Dim oOutlook As New Outlook.Application

Private Sub cmdAdd_Click()
Dim oContact As Outlook.ContactItem
With oOutlook
Set oContact = .CreateItem(olContactItem)
With oContact
.FirstName = txtFirst.Text & ""
.LastName = txtLast.Text & ""
.HomeAddressStreet = txtAddress.Text & ""
.HomeAddressCity = txtCity.Text & ""
.HomeAddressState = txtState.Text & ""
.HomeAddressPostalCode = txtZip.Text & ""
.Save
End With
End With
Set oContact = Nothing
End Sub

Private Sub Form_Unload(Cancel As Integer)
Set oOutlook = Nothing
End Sub

lingling
Jun 18th, 2001, 12:47 AM
Thanx
i will try it...