Alyson, Are you trying to add an appointment or contact card into Outlook?
Merrick --- In [email protected], "Alyson Dunsford" <[EMAIL PROTECTED]> wrote: > > Hi Group > > > > I am trying to add an outlook contact from my access database. This code is > attached to the OnClick event of a command button and works fine .it adds > the contact and enters in the full name. Problems start happening when I > try to add additional fields within the WITH statement. I get an Error 438 > message Object doesn't support this property or method. Does anyone have > any ideas??? > > > > Thanks for your input > > > > > > Private Sub AddOLContact_Click() > > > > On Error GoTo AddAppt_Err > > 'Save record first to be sure required fields are filled. > > DoCmd.RunCommand acCmdSaveRecord > > 'Exit the procedure if appointment has been added to Outlook > > If Me!AddedToOutlook = True Then > > MsgBox "This appointment already added to Microsoft Outlook" > > Exit Sub > > 'Add a new appointment > > Else > > Dim outobj As Outlook.Application > > Dim outappot As Outlook.ContactItem > > Set outobj = CreateObject("outlook.application") > > Set outappt = outobj.CreateItem(olContactItem) > > With outappt > > .FullName = Me.FName & " " & Me.LName > > > > .Save > > End With > > End If > > 'Release the Outlook object variable > > Set outobj = Nothing > > 'Set the AddedToOutlook flag, save the record, display a message > > Me!AddedToOutlook = True > > DoCmd.RunCommand acCmdSaveRecord > > MsgBox "Contact Added!" > > Exit Sub > > AddAppt_Err: > > MsgBox "Error " & Err.Number & vbCrLf & Err.Description > > Exit Sub > > > > End Sub > > > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.5.472 / Virus Database: 269.9.0/852 - Release Date: 6/17/2007 > 8:23 AM > > > > [Non-text portions of this message have been removed] >
