Avatar billede omp Novice
12. oktober 2001 - 11:51 Der er 7 kommentarer og
1 løsning

Access - Outlook

Jeg har en lavet en database (Accesss 2000) hvori der er en tabel/formular indeholdende Firmanavn
Adresse
Post_By
Kontaktperson

I min formular ønsker jeg at oprette en knap som overfører Firmanavn og Kontaktperson til Kalender funktionen i Outlook.

Er der en som har en god idé til hvordan dette gøres !!!!
Avatar billede terry Ekspert
12. oktober 2001 - 12:36 #1
You have to have a reference to Outlook to do this.
Then place this code in the on click event of your button.

Dim OlApp As Outlook.Application
Dim OlContact As ContactItem


    Set OlApp = CreateObject(\"Outlook.application\")
    Set OlContact = OlApp.CreateItem(olContactItem)
   
    With OlContact
        \'Look at other properties for saving your info, I havent looked at these myself!

        .Save
        .Display
       
    End With
Avatar billede rashid Praktikant
12. oktober 2001 - 12:41 #2
prøv at kigge på denne side:
http://support.microsoft.com/support/kb/articles/Q161/0/12.ASP
Her er der nogle muligheder. Du skal selvfølgelig selv rette i nogle ting.
Du kan evt. prøve at søge i www.google.com vha.:
access, automation og outlook :-)
12. oktober 2001 - 12:44 #3
Placer nedenstående i et modul og kald CreateAppointment fra f.eks. en knap:

Public golApp As Outlook.Application
Public golNameSpace As Outlook.NameSpace

Function CreateAppointment()
    Dim objNewAppt As AppointmentItem
    If golApp Is Nothing Then
        If InitializeOutlook = False Then
            MsgBox \"Unable to initialize Outlook. \"
            Exit Function
        End If
    End If
   
    Set objNewAppt = golApp.CreateItem(olAppointmentItem)
    With objNewAppt
        .Recipients.Add \"TJ@makeiteasy.dk\"
        .Subject = \"Nyt møde ang.....\"
        .Categories = \"Business; Key Customer\"
        .Start = #10/20/2001 2:00:00 PM#
        .Display
    End With
End Function

Function InitializeOutlook() As Boolean
   
    On Error GoTo Init_Err
    Set golApp = New Outlook.Application            \' Application object
    Set golNameSpace = golApp.GetNamespace(\"MAPI\")  \' Namespace object
    InitializeOutlook = True
Init_Bye:
   
    Exit Function
Init_Err:
    InitializeOutlook = False
    Resume Init_Bye
   
End Function

Avatar billede terry Ekspert
12. oktober 2001 - 12:50 #4
Isnt it a contact we are wanting?

Dim OlApp As Outlook.Application
Dim OlContact As ContactItem


    Set OlApp = CreateObject(\"Outlook.application\")
    Set OlContact = OlApp.CreateItem(olContactItem)
   
    With OlContact
        \'Look at other properties for saving your info, I havent looked at these myself!

        .FullName = Me.TheName
        .BusinessAddress = Me.TheAddress
        .BusinessAddressPostalCode = Me.PostNr

        \'There are LOADS of properties you can use!

        .Save
        .Display
       
    End With
Avatar billede omp Novice
12. oktober 2001 - 12:54 #5
Tak til thomasjepsen
Gratulerer med pointene.
12. oktober 2001 - 12:57 #6
Thnx, Omp :o)

Terry-> I was just writing, that you most likely were right. But I focused on the sentence:
\"...overfører Firmanavn og Kontaktperson til KALENDER funktionen i Outlook.\"

Thats why I suggested my CreateAppointment-function.

/Thomas
Avatar billede terry Ekspert
12. oktober 2001 - 13:02 #7
Yes I can see that now Thomas, I just looked at \"Kontaktperson\" and thought what has that to do with Calendar and went from there. But the idea is still the same. So now he can create a contact and an appointment for the price of one :o)
Avatar billede terry Ekspert
12. oktober 2001 - 13:06 #8
And as far as I can see there arent any properties to place this information either!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester