automation mellem outlook og access
hvad er der i vejen med det her:Public Function StartOutlook()
On Error GoTo StartOutLook_Error
Dim spObj As Object
Dim OlContact As ContactItem
'opretter et nyt objekt af outlook.
Set spObj = CreateObject("Outlook.Application")
'opretter en nyt objekt af "opret ny kontaktperson"
Set OlContact = OlApp.CreateItem(olContactItem)
With OlContact
.FullName = Me.navn
.BusinessAddress = Me.adresse
.BusinessAddressPostalCode = Me.postnr
.BusinessAddresscity = Me.by
.Save
.Display
End With
Set OlContact = spObj.CreateItem(olContactItem)
OlContact.Display
'Afslut Microsoft Outlook.
Set spObj = Nothing
Exit Function
StartOutLook_Error:
MsgBox "Error: " & Err & " " & Error
Exit Function
End Function
