[..] Script Rendez-vous
Règles du forum
- Merci de consulter la section "Règles du forum" et plus particulièrement "Règles et Mentions Légales du site autoitscript.fr" avant d'écrire un message.
[..] Script Rendez-vous
Bonjour,
Je me permet de poster car je rencontre un souci.
Je cherche à créer un script qui me permet de gérer mes rendez-vous!
Par exemple dans ma GUI j'inscris le nom, le prénom, l'adresse, etc... du client, ensuite je choisis le motif dans une checkbox et j'aimerai enregistrer le tout dans un fichier excel comment puis-je faire?
Merci de vos réponses.
Cordialement Shade.
Je me permet de poster car je rencontre un souci.
Je cherche à créer un script qui me permet de gérer mes rendez-vous!
Par exemple dans ma GUI j'inscris le nom, le prénom, l'adresse, etc... du client, ensuite je choisis le motif dans une checkbox et j'aimerai enregistrer le tout dans un fichier excel comment puis-je faire?
Merci de vos réponses.
Cordialement Shade.
Re: [..] Script Rendez-vous
Peut-être que l'UDF Excel peut vous aidez.
http://www.autoitscript.com/forum/topic ... elcom-udf/
J'ai aussi une question, est-ce que il faut 1 fichier excel pour 1 RDV ou un seul pour tout les RDV ?
http://www.autoitscript.com/forum/topic ... elcom-udf/
J'ai aussi une question, est-ce que il faut 1 fichier excel pour 1 RDV ou un seul pour tout les RDV ?
Re: [..] Script Rendez-vous
Non un fichier par rendez-vous, si c'est possible.
Re: [..] Script Rendez-vous
Aucun problème. Je mis met de ce pas.
Je pourrais connaître les Motifs ou alors je vous laisse avec la fonction.
Je pourrais connaître les Motifs ou alors je vous laisse avec la fonction.
Re: [..] Script Rendez-vous
Laissé la fonction et vous m'expliquerai comment en ajouter comme ça je pourrais comprendre le fonctionnement 
Re: [..] Script Rendez-vous
Je vous passe ma GUI si vous voulez
► Afficher le texte
Re: [..] Script Rendez-vous
Voilà une fonction que je vous propose.
Il y a surment plus simple ^^', mais c'est ce qu'il me vient a l'esprit.
J'espère vous avoir aidé. Si vous avez une question, n'hésitez pas.
Code : Tout sélectionner
#include <Excel.au3>
_Create_Fichier_Client("X","Mr","10 rue saint glinglin","Rencontre","23/03/2011","PremierFichier")
Func _Create_Fichier_Client($_nom,$_prenom,$_addresse,$_motif,$_date,$_Fichier)
Local $oExcel = _ExcelBookNew(0);=> 0 = invisible
_ExcelWriteCell($oExcel, "Nom :", 1, 1)
_ExcelWriteCell($oExcel, $_nom, 1, 2)
_ExcelWriteCell($oExcel, "Prenom :", 2, 1)
_ExcelWriteCell($oExcel, $_prenom, 2, 2)
_ExcelWriteCell($oExcel, "Addresse :", 3, 1)
_ExcelWriteCell($oExcel, $_addresse, 3, 2)
_ExcelWriteCell($oExcel, "Motif :", 4, 1)
_ExcelWriteCell($oExcel, $_motif, 4, 2)
_ExcelWriteCell($oExcel, "Date :", 5, 1)
_ExcelWriteCell($oExcel, $_date, 5, 2)
_ExcelBookSaveAs($oExcel, @ScriptDir & "\"&$_Fichier&".xls")
_ExcelBookClose($oExcel)
EndFuncJ'espère vous avoir aidé. Si vous avez une question, n'hésitez pas.
Re: [..] Script Rendez-vous
Merci beaucoup et est ce que je peux l'intégrer dans ma gui que je vous ai fourni au dessus?
Re: [..] Script Rendez-vous
Bien-sure. Il faut juste ajouté des _ExcelWriteCell() & des variables dans la fonction.
Re: [..] Script Rendez-vous
Oula,là je suis totalement perdu...
Pourriez-vous me le faire ou pas?
Car la je viens d'essayer et au lieu que ça m'affiche le nom, j'ai un neméro
Pourriez-vous me le faire ou pas?
Car la je viens d'essayer et au lieu que ça m'affiche le nom, j'ai un neméro
Re: [..] Script Rendez-vous
J'y travaille déjà 
Re: [..] Script Rendez-vous
Tu ne galères pas trop Zippo?
Re: [..] Script Rendez-vous
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <excel.au3>
;Début de l'interface graphique;
Global $Form1_1 = GUICreate("Prise de rendez-vous", 633, 525, 192, 124)
Global $Fichier = GUICtrlCreateMenu("&Fichier")
Global $Sauvegarder = GUICtrlCreateMenuItem("Sauvegarder", $Fichier)
Global $Client = GUICtrlCreateGroup("Client", 8, 16, 289, 313)
Global $Nom = GUICtrlCreateLabel("Nom", 32, 56, 26, 17)
Global $Prenom = GUICtrlCreateLabel("Prénom", 32, 96, 40, 17)
Global $Adresse = GUICtrlCreateLabel("Adresse", 32, 136, 42, 17)
Global $CP = GUICtrlCreateLabel("CP", 32, 208, 18, 17)
Global $Ville = GUICtrlCreateLabel("Ville", 32, 248, 23, 17)
Global $Telephone = GUICtrlCreateLabel("Téléphone", 32, 288, 55, 17)
Global $Input1 = GUICtrlCreateInput("", 104, 56, 121, 21)
Global $Input2 = GUICtrlCreateInput("", 104, 96, 121, 21)
Global $Input3 = GUICtrlCreateInput("", 104, 136, 185, 50)
Global $Input4 = GUICtrlCreateInput("", 104, 208, 121, 21)
Global $Input5 = GUICtrlCreateInput("", 104, 248, 121, 21)
Global $Input6 = GUICtrlCreateInput("", 104, 288, 121, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Evenements = GUICtrlCreateGroup("Evènements", 320, 16, 257, 273)
Global $Combo1 = GUICtrlCreateCombo("", 408, 88, 145, 25)
GUICtrlSetData(-1, "Mariage|Baptême|Sports|Studio")
Global $Types = GUICtrlCreateLabel("Types", 336, 88, 33, 17)
Global $Options = GUICtrlCreateLabel("Options", 336, 136, 40, 17)
Global $Preparation = GUICtrlCreateCheckbox("Préparation", 408, 136, 97, 17)
Global $Mairie = GUICtrlCreateCheckbox("Mairie", 408, 160, 97, 17)
Global $Eglise = GUICtrlCreateCheckbox("Eglise", 408, 184, 97, 17)
Global $Photos_couple = GUICtrlCreateCheckbox("Photos couple", 408, 208, 97, 17)
Global $Vin = GUICtrlCreateCheckbox("Vin", 408, 232, 97, 17)
Global $Soiree = GUICtrlCreateCheckbox("Soirée", 408, 256, 97, 17)
Global $Date = GUICtrlCreateLabel("Date", 336, 48, 27, 17)
Global $Input7 = GUICtrlCreateInput("", 408, 48, 121, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Remarques = GUICtrlCreateGroup("Remarques", 320, 304, 257, 97)
Global $Input8 = GUICtrlCreateInput("", 328, 328, 241, 60)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Sauvegarde = GUICtrlCreateButton("Sauvegarder", 72, 344, 171, 25, $WS_GROUP)
Global $Quitte = GUICtrlCreateButton("Quitter", 72, 384, 171, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
;Fin de l'interface graphique;
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Sauvegarde
_verif_Gui(GUICtrlRead($Input1),GUICtrlRead($Input2),GUICtrlRead($Input3),GUICtrlRead($Input4),GUICtrlRead($Input5),GUICtrlRead($Input6),GUICtrlRead($Input7),GUICtrlRead($Input8),GUICtrlRead($Combo1),GUICtrlRead($Preparation),GUICtrlRead($Mairie),GUICtrlRead($Eglise),GUICtrlRead($Photos_couple),GUICtrlRead($Vin),GUICtrlRead($Soiree))
Case $Quitte
Exit
Case $Sauvegarder
_verif_Gui(GUICtrlRead($Input1),GUICtrlRead($Input2),GUICtrlRead($Input3),GUICtrlRead($Input4),GUICtrlRead($Input5),GUICtrlRead($Input6),GUICtrlRead($Input7),GUICtrlRead($Input8),GUICtrlRead($Combo1),GUICtrlRead($Preparation),GUICtrlRead($Mairie),GUICtrlRead($Eglise),GUICtrlRead($Photos_couple),GUICtrlRead($Vin),GUICtrlRead($Soiree))
EndSwitch
WEnd
Func _verif_Gui($_nom,$_prenom,$_addresse,$_CP,$_Ville,$_Tel,$_Date,$_Remarques,$_Type,$_Preparation,$_Mairie,$_Eglise,$_Photos_couple,$_Vin,$_Soiree)
Local $Options
If $_nom= "" OR $_prenom= "" OR $_addresse= "" OR $_CP= "" OR $_Ville= "" OR $_Tel= "" OR $_Date= "" OR $_Remarques= "" OR $_Type = "" Then
MsgBox(0,"Erreur","Un ou plusieurs champ(s) ne son pas remplit.")
Return 0
EndIf
If $_Preparation = "1" Then
$Options &= "Preparation|"
EndIf
If $_Mairie = "1" Then
$Options &= "Mairie|"
EndIf
If $_Eglise = "1" Then
$Options &= "Eglise|"
EndIf
If $_Photos_couple = "1" Then
$Options &= "Photos Couple"
EndIf
If $_Vin = "1" Then
$Options &= "Vin|"
EndIf
If $_Soiree = "1" Then
$Options &= "Soirée"
EndIf
_Create_Fichier_Client($_nom,$_prenom,$_addresse,$_CP,$_Ville,$_Tel,$_Date,$_Type,$Options,$_Remarques)
EndFunc
Func _Create_Fichier_Client($_nom,$_prenom,$_addresse,$_CP,$_Ville,$_Tel,$_Date,$_Type,$Options,$_Remarques)
Local $oExcel = _ExcelBookNew(0),$_Fichier = $_nom,$i = 0
_ExcelWriteCell($oExcel, "Nom :", 1, 1)
_ExcelWriteCell($oExcel, $_nom, 1, 2)
_ExcelWriteCell($oExcel, "Prenom :", 2, 1)
_ExcelWriteCell($oExcel, $_prenom, 2, 2)
_ExcelWriteCell($oExcel, "Addresse :", 3, 1)
_ExcelWriteCell($oExcel, $_addresse, 3, 2)
_ExcelWriteCell($oExcel, "CP :", 4, 1)
_ExcelWriteCell($oExcel, $_CP, 4, 2)
_ExcelWriteCell($oExcel, "Ville :", 5, 1)
_ExcelWriteCell($oExcel, $_Ville, 5, 2)
_ExcelWriteCell($oExcel, "Téléphone :", 6, 1)
_ExcelWriteCell($oExcel, $_Tel, 6, 2)
_ExcelWriteCell($oExcel, "Date :", 7, 1)
_ExcelWriteCell($oExcel, $_Date, 7, 2)
_ExcelWriteCell($oExcel, "Types :", 8, 1)
_ExcelWriteCell($oExcel, $_Type, 8, 2)
_ExcelWriteCell($oExcel, "Options :", 9, 1)
_ExcelWriteCell($oExcel, $Options, 9, 2)
_ExcelWriteCell($oExcel, "Remarques :", 10, 1)
_ExcelWriteCell($oExcel, $_Remarques, 10, 2)
$f = _ExcelBookSaveAs($oExcel, @ScriptDir & "\"&$_Fichier&".xls")
if @error Then
While 1
$i = $i + 1
$f = _ExcelBookSaveAs($oExcel, @ScriptDir & "\"&$_Fichier&"("&$i&").xls")
If $f = 1 Then ExitLoop
WEnd
EndIf
_ExcelBookClose($oExcel)
EndFuncPs : Désolé pour les fautes d'orthographes mais je suis assez nul de ce côté & Aussi désolé pour le temps que j'ai mis ^^' mais il m'a fallut retaper toutes les variables^^.
Re: [..] Script Rendez-vous
No souci, je te remercie, tu me sauves la vie, tu es mon héros 
Re: [..] Script Rendez-vous
De rien l'ami ! 
Je le rédit car il y avait 2 erreurs au niveau des options.
Je le rédit car il y avait 2 erreurs au niveau des options.
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <excel.au3>
;Début de l'interface graphique;
Global $Form1_1 = GUICreate("Prise de rendez-vous", 633, 525, 192, 124)
Global $Fichier = GUICtrlCreateMenu("&Fichier")
Global $Sauvegarder = GUICtrlCreateMenuItem("Sauvegarder", $Fichier)
Global $Client = GUICtrlCreateGroup("Client", 8, 16, 289, 313)
Global $Nom = GUICtrlCreateLabel("Nom", 32, 56, 26, 17)
Global $Prenom = GUICtrlCreateLabel("Prénom", 32, 96, 40, 17)
Global $Adresse = GUICtrlCreateLabel("Adresse", 32, 136, 42, 17)
Global $CP = GUICtrlCreateLabel("CP", 32, 208, 18, 17)
Global $Ville = GUICtrlCreateLabel("Ville", 32, 248, 23, 17)
Global $Telephone = GUICtrlCreateLabel("Téléphone", 32, 288, 55, 17)
Global $Input1 = GUICtrlCreateInput("", 104, 56, 121, 21)
Global $Input2 = GUICtrlCreateInput("", 104, 96, 121, 21)
Global $Input3 = GUICtrlCreateInput("", 104, 136, 185, 50)
Global $Input4 = GUICtrlCreateInput("", 104, 208, 121, 21)
Global $Input5 = GUICtrlCreateInput("", 104, 248, 121, 21)
Global $Input6 = GUICtrlCreateInput("", 104, 288, 121, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Evenements = GUICtrlCreateGroup("Evènements", 320, 16, 257, 273)
Global $Combo1 = GUICtrlCreateCombo("", 408, 88, 145, 25)
GUICtrlSetData(-1, "Mariage|Baptême|Sports|Studio")
Global $Types = GUICtrlCreateLabel("Types", 336, 88, 33, 17)
Global $Options = GUICtrlCreateLabel("Options", 336, 136, 40, 17)
Global $Preparation = GUICtrlCreateCheckbox("Préparation", 408, 136, 97, 17)
Global $Mairie = GUICtrlCreateCheckbox("Mairie", 408, 160, 97, 17)
Global $Eglise = GUICtrlCreateCheckbox("Eglise", 408, 184, 97, 17)
Global $Photos_couple = GUICtrlCreateCheckbox("Photos couple", 408, 208, 97, 17)
Global $Vin = GUICtrlCreateCheckbox("Vin", 408, 232, 97, 17)
Global $Soiree = GUICtrlCreateCheckbox("Soirée", 408, 256, 97, 17)
Global $Date = GUICtrlCreateLabel("Date", 336, 48, 27, 17)
Global $Input7 = GUICtrlCreateInput("", 408, 48, 121, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Remarques = GUICtrlCreateGroup("Remarques", 320, 304, 257, 97)
Global $Input8 = GUICtrlCreateInput("", 328, 328, 241, 60)
GUICtrlCreateGroup("", -99, -99, 1, 1)
Global $Sauvegarde = GUICtrlCreateButton("Sauvegarder", 72, 344, 171, 25, $WS_GROUP)
Global $Quitte = GUICtrlCreateButton("Quitter", 72, 384, 171, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
;Fin de l'interface graphique;
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Sauvegarde
_verif_Gui(GUICtrlRead($Input1),GUICtrlRead($Input2),GUICtrlRead($Input3),GUICtrlRead($Input4),GUICtrlRead($Input5),GUICtrlRead($Input6),GUICtrlRead($Input7),GUICtrlRead($Input8),GUICtrlRead($Combo1),GUICtrlRead($Preparation),GUICtrlRead($Mairie),GUICtrlRead($Eglise),GUICtrlRead($Photos_couple),GUICtrlRead($Vin),GUICtrlRead($Soiree))
Case $Quitte
Exit
Case $Sauvegarder
_verif_Gui(GUICtrlRead($Input1),GUICtrlRead($Input2),GUICtrlRead($Input3),GUICtrlRead($Input4),GUICtrlRead($Input5),GUICtrlRead($Input6),GUICtrlRead($Input7),GUICtrlRead($Input8),GUICtrlRead($Combo1),GUICtrlRead($Preparation),GUICtrlRead($Mairie),GUICtrlRead($Eglise),GUICtrlRead($Photos_couple),GUICtrlRead($Vin),GUICtrlRead($Soiree))
EndSwitch
WEnd
Func _verif_Gui($_nom,$_prenom,$_addresse,$_CP,$_Ville,$_Tel,$_Date,$_Remarques,$_Type,$_Preparation,$_Mairie,$_Eglise,$_Photos_couple,$_Vin,$_Soiree)
Local $Options
If $_nom= "" OR $_prenom= "" OR $_addresse= "" OR $_CP= "" OR $_Ville= "" OR $_Tel= "" OR $_Date= "" OR $_Remarques= "" OR $_Type = "" Then
MsgBox(0,"Erreur","Un ou plusieurs champ(s) ne son pas remplit.")
Return 0
EndIf
If $_Preparation = "1" Then
$Options &= "Preparation|"
EndIf
If $_Mairie = "1" Then
$Options &= "Mairie|"
EndIf
If $_Eglise = "1" Then
$Options &= "Eglise|"
EndIf
If $_Photos_couple = "1" Then
$Options &= "Photos Couple|"
EndIf
If $_Vin = "1" Then
$Options &= "Vin|"
EndIf
If $_Soiree = "1" Then
$Options &= "Soirée|"
EndIf
_Create_Fichier_Client($_nom,$_prenom,$_addresse,$_CP,$_Ville,$_Tel,$_Date,$_Type,$Options,$_Remarques)
EndFunc
Func _Create_Fichier_Client($_nom,$_prenom,$_addresse,$_CP,$_Ville,$_Tel,$_Date,$_Type,$Options,$_Remarques)
Local $oExcel = _ExcelBookNew(0),$_Fichier = $_nom,$i = 0
_ExcelWriteCell($oExcel, "Nom :", 1, 1)
_ExcelWriteCell($oExcel, $_nom, 1, 2)
_ExcelWriteCell($oExcel, "Prenom :", 2, 1)
_ExcelWriteCell($oExcel, $_prenom, 2, 2)
_ExcelWriteCell($oExcel, "Addresse :", 3, 1)
_ExcelWriteCell($oExcel, $_addresse, 3, 2)
_ExcelWriteCell($oExcel, "CP :", 4, 1)
_ExcelWriteCell($oExcel, $_CP, 4, 2)
_ExcelWriteCell($oExcel, "Ville :", 5, 1)
_ExcelWriteCell($oExcel, $_Ville, 5, 2)
_ExcelWriteCell($oExcel, "Téléphone :", 6, 1)
_ExcelWriteCell($oExcel, $_Tel, 6, 2)
_ExcelWriteCell($oExcel, "Date :", 7, 1)
_ExcelWriteCell($oExcel, $_Date, 7, 2)
_ExcelWriteCell($oExcel, "Types :", 8, 1)
_ExcelWriteCell($oExcel, $_Type, 8, 2)
_ExcelWriteCell($oExcel, "Options :", 9, 1)
_ExcelWriteCell($oExcel, $Options, 9, 2)
_ExcelWriteCell($oExcel, "Remarques :", 10, 1)
_ExcelWriteCell($oExcel, $_Remarques, 10, 2)
$f = _ExcelBookSaveAs($oExcel, @ScriptDir & "\"&$_Fichier&".xls")
if @error Then
While 1
$i = $i + 1
$f = _ExcelBookSaveAs($oExcel, @ScriptDir & "\"&$_Fichier&"("&$i&").xls")
If $f = 1 Then ExitLoop
WEnd
EndIf
_ExcelBookClose($oExcel)
EndFuncRe: [..] Script Rendez-vous
est-ce possible de mettre les options les unes en dessous des autres ou pas?
Re: [..] Script Rendez-vous
Hum...Peut-être, je vais faire des tests. Jte tiens au courrant.
Re: [..] Script Rendez-vous
Ok merci 
Re: [..] Script Rendez-vous
► Afficher le texte


