Hi everyone
i currently use the code below as early binding to create a contact in out look when a button on my form is pressed
Code:
Private Sub OutlookContact_Click()
Dim strInput As String
Dim rsdbase As Database
Dim rstemp As Recordset
Dim olns As NameSpace
Dim cf As MAPIFolder
Dim c As ContactItem
Dim ol As New Outlook.Application
Set olns = ol.GetNamespace("MAPI")
Set cf = olns.GetDefaultFolder(olFolderContacts)
Set rsdbase = CurrentDb
Set rstemp = rsdbase.OpenRecordset("qryCustomersDetails")
With rstemp
Set c = ol.CreateItem(olContactItem)
c.MessageClass = "IPM.Contact"
Set c = cf.Items.Add
' Me.CustomerID = ![CustomerID]
If Me.Business_Name <> "" Then c.CompanyName = Me.Business_Name
If Me.First_Name <> "" Then c.firstname = Me.First_Name
If Me.Last_Name <> "" Then c.LastName = Me.Last_Name
If Me.[E-Mail Address] <> "" Then c.Email1Address = Me.[E-Mail Address]
If Me.Phone_Number <> "" Then c.HomeTelephoneNumber = Me.Phone_Number
If Me.Street <> "" Then c.HomeAddressStreet = Me.Street
If Me.Town <> "" Then c.HomeAddressCity = Me.Town
If Me.County <> "" Then c.HomeAddressState = Me.County
If Me.Post_Code <> "" Then c.HomeAddressPostalCode = Me.Post_Code
If Me.Web_Site <> "" Then c.WebPage = Me.Web_Site
c.Save
End With
Set ol = Nothing
Set olns = Nothing
Me.Added_to_Outlook = True
MsgBox "All Contacts Successfully Exported to Outlook!"
Me.OutlookContact.Visible = True
Me.Requery
end sub
I am totally stuck on changing this to Late binding so that i can get ride of the references, any help would be most gratefully received
many thanks in advance
Steve