ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Comment utliser l'activex d'Outlook   



L'auteur

Mike Gagnon
Canada Canada
Membre Simple
# 0000000025
enregistré le 14/10/2004

Gagnon Mike
Pointe Cla H9R 3K8
de la société Carver Technologies Inc.
Fiche personnelle


Note des membres
pas de note

Contributions > 08 - ActiveX - (OLE)

Comment utliser l'activex d'Outlook
# 0000000161
ajouté le 16/03/2005 13:59:15 et modifié le 29/03/2006
consulté 10995 fois
Niveau initié

Version(s) Foxpro :
VFP 9.0
VFP 8.0
VFP 7.0
VFP 6.0

Description
Voici comment créer un interface FoxPro pour gérer Outlook en utilisant l'OCX de Outlook.
Code source :
Public oform1
oform1=createobject("form1")
oform1.Show
Return
******************************************************
Define Class form1 As Form

    Height = 400
    Width = 620
    DoCreate = .T.
    Caption = "Form1"
    Name = "Form1"

    Add Object cmdExit As CommandButton With ;
        Top = 330, ;
        Left = 504, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "E\<xit", ;
        Name = "CmdExit"

    Add Object cmdCalendar As CommandButton With ;
        Top = 330, ;
        Left = 12, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "\<Calendar", ;
        Name = "CmdCalendar"

    Add Object cmdInBox As CommandButton With ;
        Top = 330, ;
        Left = 108, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "\<In Box", ;
        Name = "CmdInBox"

    Add Object cmdSent As CommandButton With ;
        Top = 330, ;
        Left = 204, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "\<Sent Mail", ;
        Name = "CmdSent"

    Add Object cmdContact As CommandButton With ;
        Top = 330, ;
        Left = 300, ;
        Height = 27, ;
        Width = 84, ;
        Caption = "\<AddressBook", ;
        Name = "CmdContact"

    Add Object cmdNewMail As CommandButton With ;
        Top = 360, ;
        Left =12 , ;
        Height = 27, ;
        Width = 84, ;
        Caption = "New \<Mail", ;
        Name = "cmdNewMail"

    Add Object cmdNewTask As CommandButton With ;
        Top = 360, ;
        Left =108 , ;
        Height = 27, ;
        Width = 84, ;
        Caption = "New \<Task", ;
        Name = "cmdNewTask"

    Add Object cmdNewContact As CommandButton With ;
        Top = 360, ;
        Left =204 , ;
        Height = 27, ;
        Width = 84, ;
        Caption = "\<New Contact", ;
        Name = "cmdNewContact"

    Add Object cmdNewAppointment As CommandButton With ;
        Top = 360, ;
        Left =300 , ;
        Height = 27, ;
        Width = 110, ;
        Caption = "New A\<ppointment", ;
        Name = "cmdNewAppointment"

    Add Object olecontrol1 As OleControl With ;
        Top = 12, ;
        Left = 12, ;
        Height = 306, ;
        Width = 588, ;
        Name = "Olecontrol1", ;
        OleClass = "OVCtl.OVCtl.1"

    Procedure cmdExit.Click
       Thisform.Release()
    Endproc

    Procedure cmdNewMail.Click
       Thisform.olecontrol1.NewMessage()
    ENDPROC

    Procedure cmdNewTask.Click
       Thisform.olecontrol1.NewTask()
    Endproc

    Procedure cmdNewContact.Click
       Thisform.olecontrol1.NewContact()
    ENDPROC

    Procedure cmdNewAppointment.Click
       Thisform.olecontrol1.NewAppointment()
    Endproc

    Procedure cmdCalendar.Click
       Thisform.olecontrol1.Folder = "CALENDAR"
       Thisform.Caption = "OutLook Calendar"
       Thisform.Refresh()
    Endproc

    Procedure cmdInBox.Click
       Thisform.olecontrol1.Folder = "INBOX"
       Thisform.Caption = "OutLook InBox"
       Thisform.Refresh()
    Endproc

    Procedure cmdSent.Click
       Thisform.olecontrol1.Folder = "SENT ITEMS"
       Thisform.Caption = "OutLook Sent Items"
       Thisform.Refresh()
    Endproc

    Procedure cmdContact.Click
       Thisform.olecontrol1.Folder = "CONTACTS"
       Thisform.Caption = "OutLook Address Book"
       Thisform.Refresh()
    Endproc

    Procedure olecontrol1.Init
       This.Folder = "InBox"
    Endproc

Enddefine

Commentaires
Aucun commentaire enregistré ...

Publicité

Les pubs en cours :


www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2024.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3