Jump to content
Sign in to follow this  
lafafmentvotre

My script doesn't work

Recommended Posts

lafafmentvotre

Hi everybody and sorry for my bad english.

I made a script to generate, modifiy and save an html signature for exchange with french or english interface.

But it doesn't work.

To create a signature it's Ok

To open it's ok

but when i want to open, modify and save it doesn't work. Just the preview works with a modification in an existing signature.

Who can help me to find the error ?

Thanks by advance

Break(1)
;###################################################################
;AutoIT Variables
#include <GuiConstants.au3>
#include <GUIConstantsEx.au3>
#include <File.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <Excel.au3>
;###################################################################
;Script Variables
Local $blank=""
Local $aConvert[9][2] = [["[àáâãäåÀÁÂÃÄÅ]","a"],["[éèêëÈÉÊË]","e"],["[ìíîï]","i"],["[çÇ]","c"],["[ ]","-"],["ñ","n"],["[òóôõö]","o"],["[ùúûüÙÚÛÜ]","u"],["[ýÿ]","y"]]
Local $file,$mail, $htmLblSource,$ID_add, $ID_rs, $ID_logo, $rs1, $rs2, $rs3, $rs4, $rs5,$filedir, $var, $fr_version,$en_version, $version,$desfilename
$version="V1.0"
;###################################################################
;Installation fichiers locaux
DirCreate(@TempDir & "\helpgui")
DirCreate(@TempDir & "\helpgui\helpgui_fichiers")
FileInstall("helpgui\Signature_Introduction.html", @TempDir & "\helpgui\Signature_Introduction.html",1)
FileInstall("helpgui\Signature_Description.html", @TempDir & "\helpgui\Signature_Description.html",1)
FileInstall("helpgui\Signature_Creation.html", @TempDir & "\helpgui\Signature_Creation.html",1)
FileInstall("helpgui\Signature_Modification.html", @TempDir & "\helpgui\Signature_Modification.html",1)
FileInstall("helpgui\Signature_CSS.css", @TempDir & "\helpgui\Signature_CSS.css",1)
FileInstall("helpgui\helpgui_fichiers\filelist.xml", @TempDir & "\helpgui\helpgui_fichiers\filelist.xml",1)
FileInstall("helpgui\helpgui_fichiers\image001.jpg", @TempDir & "\helpgui\helpgui_fichiers\image001.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image002.jpg", @TempDir & "\helpgui\helpgui_fichiers\image002.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image003.jpg", @TempDir & "\helpgui\helpgui_fichiers\image003.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image004.jpg", @TempDir & "\helpgui\helpgui_fichiers\image004.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image005.jpg", @TempDir & "\helpgui\helpgui_fichiers\image005.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image006.jpg", @TempDir & "\helpgui\helpgui_fichiers\image006.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image007.jpg", @TempDir & "\helpgui\helpgui_fichiers\image007.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image008.jpg", @TempDir & "\helpgui\helpgui_fichiers\image008.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image009.jpg", @TempDir & "\helpgui\helpgui_fichiers\image009.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image010.jpg", @TempDir & "\helpgui\helpgui_fichiers\image010.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image011.jpg", @TempDir & "\helpgui\helpgui_fichiers\image011.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image012.jpg", @TempDir & "\helpgui\helpgui_fichiers\image012.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image013.jpg", @TempDir & "\helpgui\helpgui_fichiers\image013.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image014.jpg", @TempDir & "\helpgui\helpgui_fichiers\image014.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image015.jpg", @TempDir & "\helpgui\helpgui_fichiers\image015.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image016.jpg", @TempDir & "\helpgui\helpgui_fichiers\image016.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image017.jpg", @TempDir & "\helpgui\helpgui_fichiers\image017.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image018.jpg", @TempDir & "\helpgui\helpgui_fichiers\image018.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image019.jpg", @TempDir & "\helpgui\helpgui_fichiers\image019.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image020.jpg", @TempDir & "\helpgui\helpgui_fichiers\image020.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image021.jpg", @TempDir & "\helpgui\helpgui_fichiers\image021.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image022.jpg", @TempDir & "\helpgui\helpgui_fichiers\image022.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image023.jpg", @TempDir & "\helpgui\helpgui_fichiers\image023.jpg",1)
FileInstall("helpgui\helpgui_fichiers\image024.jpg", @TempDir & "\helpgui\helpgui_fichiers\image024.jpg",1)
FileInstall("logo.bmp", @TempDir & "\helpgui\logo.bmp",1)
;LANGUAGE
$recup_info=GuiCreate("", 300, 50, -1, -1, $WS_POPUPWINDOW)
$fr_version=GUICtrlCreateRadio("Version Française",40, 15, 110,20)
$en_version=GUICtrlCreateRadio("English Version",160, 15, 100,20)
GUISetState(@SW_SHOW,$recup_info)
While 1
$listener = GUIGetMsg()
Select
Case $listener=$fr_version
$version="FR"
ExitLoop
Case $listener=$en_version
$version="EN"
ExitLoop
EndSelect
WEnd

Select
;#####################################################################################
;################################## FRENCH VERSION ###################################
;#####################################################################################
Case $version="FR"
;Script
$gui = GuiCreate(" "& StringTrimRight(@ScriptName,4) & " "& $version &"", 410, 380, -1, -1,$WS_POPUPWINDOW)
GUISetBkColor(0xD9E3E9)
$logo = @TempDir & "\helpgui\logo.bmp"
GUICtrlCreatePic($logo,135, 320, 0, 0)
; MENU Fichier
$filemenu=GUICtrlCreateMenu ("&Fichier")
$openitem=GUICtrlCreateMenuitem ("Ouvrir",$filemenu)
$viewitem=GUICtrlCreateMenuitem ("Aperçu",$filemenu)
$createitem=GUICtrlCreateMenuitem ("Créer",$filemenu)
$resetitem=GUICtrlCreateMenuitem ("Réinitialiser",$filemenu)
$exititem=GUICtrlCreateMenuitem ("Quitter",$filemenu)
; MENU Aide
$helpmenu=GUICtrlCreateMenu ("&?")
$helpitem=GUICtrlCreateMenuitem ("Aide",$helpmenu)
;BOUTONS
$ctrlbutton0=GuiCtrlCreateButton("Ouvrir", 18, 280, 70, 20,$BS_FLAT)
$ctrlbutton1=GuiCtrlCreateButton("Aperçu", 93, 280, 70, 20,$BS_FLAT)
$ctrlbutton2=GuiCtrlCreateButton("Créer", 168, 280, 70, 20,$BS_FLAT)
$ctrlbutton3=GuiCtrlCreateButton("Réinitialiser", 243, 280, 70, 20,$BS_FLAT)
$ctrlbutton4=GuiCtrlCreateButton("Quitter", 318, 280, 70, 20,$BS_FLAT)
;CHAMPS DE SAISIE UTILISATEUR
;Nom
$nomlbl=GUICtrlCreateLabel("Nom :", 10, 32, 57, 20, $SS_RIGHT)
$nom=GUICtrlCreateInput("", 70, 30, 300, 20,$ES_UPPERCASE)
;Prenom
$prenomlbl = GUICtrlCreateLabel("Prénom :", 10, 57, 57, 20,$SS_RIGHT)
$prenom = GUICtrlCreateInput("", 70, 55, 300, 20)
;Titre
$titrelbl = GUICtrlCreateLabel("Titre :", 10, 82, 57, 20,$SS_RIGHT)
$titre = GUICtrlCreateInput("", 70, 80, 300, 20)
;Telephone
$telephonelbl = GUICtrlCreateLabel("Tel :", 10, 107, 57, 20,$SS_RIGHT)
$telephone = GUICtrlCreateInput("", 70, 105, 300, 20)
;Fax
$faxlbl = GUICtrlCreateLabel("Fax :", 10, 132, 57, 20,$SS_RIGHT)
$fax = GUICtrlCreateInput("", 70, 130, 300, 20)
;Mobile
$mobilelbl = GUICtrlCreateLabel("Gsm :", 10, 157, 57, 20,$SS_RIGHT)
$mobile = GUICtrlCreateInput("", 70, 155, 300, 20)
;E-mail
$maillbl = GUICtrlCreateLabel("E-Mail :", 10, 182, 57, 20, $SS_RIGHT)
$mail = GUICtrlCreateInput("", 70, 180, 150, 20)
$mailsuff = GUICtrlCreateCombo("", 230, 180, 140, 20)
GUICtrlSetData($mailsuff,"@toto.com|@tata.com|@titi.com|@tutu.com")
;Sauvegarde
$htmLblSource = GUICtrlCreateInput("Cliquez sur ""Enregistrez sous...""", 25, 240, 270, 20)
$htmsaveSource = GUICtrlCreateButton("Enregistrez sous...", 300, 240, 95, 20,$BS_FLAT)
GUIDelete($recup_info)
GUISetState(@SW_SHOW,$gui)

While 1
$listener = GUIGetMsg()
;VARIABLES
$name=GUICtrlRead($nom)
$surname=GUICtrlRead($prenom)
$surname=StringUpper(StringMid($surname,1,1)) & StringMid($surname,2,StringLen($surname) - 1)
$prenom_2=GUICtrlSetData($prenom, $surname, "")
$title=GUICtrlRead($titre)
$phone=GUICtrlRead($telephone)
$num_fax=GUICtrlRead($fax)
$gsm=GUICtrlRead($mobile)
$email=GUICtrlRead($mail)
$email2=GUICtrlRead($mailsuff)
$lbl=GUICtrlRead($htmLblSource)
$temp_sign=@TempDir & "\_Signature "& $surname &" "& $name &".htm"
$temp_help=@TempDir & "\helpgui\Signature_Introduction.html"
Select
;Fermeture
Case $listener = $GUI_EVENT_PRIMARYDOWN
accent()

Case $listener = $GUI_EVENT_CLOSE Or $listener = $exititem Or $listener = $ctrlbutton4
If FileExists(@TempDir & "\_Signature *.*") Then
FileDelete(@TempDir & "\_Signature *.*")
EndIf
DirRemove(@TempDir & "\helpgui", 1) 
ExitLoop
;Reset
Case $listener=$resetitem or $listener=$ctrlbutton3
GUICtrlSetData($nom,$blank)
GUICtrlSetData($prenom,$blank)
GUICtrlSetData($titre,$blank)
GUICtrlSetData($telephone,$blank)
GUICtrlSetData($fax,$blank)
GUICtrlSetData($mobile,$blank)
GUICtrlSetData($mail,$blank)
GUICtrlSetData($mailsuff,$blank)
GUICtrlSetData($mailsuff,"@toto.com|@tata.com|@titi.com|@tutu.com")
GUICtrlSetData($htmLblSource,"Cliquez sur ""Enregistrez sous...""")
;Ouvrir
Case $listener=$openitem or $listener=$ctrlbutton0
$file=FileOpenDialog("Selectionnez votre fichier signature", @MyDocumentsDir,"Documents HTM (*.htm)",0)
FileOpen($file,0)
;Lecture NOM
$nomread=FileReadLine($file, 3)
$nomread = StringReplace(StringReplace($nomread, "<!--NOM:", ""), "-->", "")
GUICtrlSetData($nom,$nomread)
;Lecture PRENOM
$prenomread=FileReadLine($file, 4)
$prenomread = StringReplace(StringReplace($prenomread, "<!--PRENOM:", ""), "-->", "")
GUICtrlSetData($prenom,$prenomread)
;Lecture TITRE
$titreread=FileReadLine($file, 5)
$titreread = StringReplace(StringReplace($titreread, "<!--TITRE:", ""), "-->", "")
GUICtrlSetData($titre,$titreread)
;Lecture TELEPHONE
$telephoneread=FileReadLine($file, 6)
$telephoneread = StringReplace(StringReplace($telephoneread, "<!--TELEPHONE:", ""), "-->", "")
GUICtrlSetData($telephone,$telephoneread)
;Lecture FAX
$faxread=FileReadLine($file, 7)
$faxread = StringReplace(StringReplace($faxread, "<!--FAX:", ""), "-->", "")
GUICtrlSetData($fax,$faxread)
;Lecture MOBILE
$mobileread=FileReadLine($file, 8)
$mobileread = StringReplace(StringReplace($mobileread, "<!--MOBILE:", ""), "-->", "")
GUICtrlSetData($mobile,$mobileread)
;Lecture MAIL
$mailread=FileReadLine($file, 9)
$mailread = StringReplace(StringReplace($mailread, "<!--MAIL:", ""), "-->", "")
GUICtrlSetData($mail,$mailread)
$mailsuffread=FileReadLine($file, 10)
$mailsuffread = StringReplace(StringReplace($mailsuffread, "<!--MAILSUFF:", ""), "-->", "")
GUICtrlSetData($mailsuff,$mailsuffread)
;Emplacement FICHIER
GUICtrlSetData($htmLblSource,$file)
FileClose($file)
;Aide
Case $listener= $helpitem
ShellExecute($temp_help,0)
;Selection du nom de fichier et dossier de destination
Case $listener = $htmsaveSource
GUICtrlSetData($htmLblSource, FileSaveDialog("Selectionnez la destination du fichier htm", @MyDocumentsDir, "Documents HTM (*.htm)"))
$filedir = GUICtrlSetData($htmLblSource,StringReplace(GUICtrlRead($htmLblSource) & ".htm", "vbs", "htm"))
$dest = GUICtrlRead($htmLblSource)
result($dest)
If $var=".htm" Then
GUICtrlSetData($htmLblSource,"Cliquez sur ""Enregistrez sous...""")
Else
GUICtrlSetData($htmLblSource,$var)
MsgBox(64, "Information", "Pour que votre signature soit créée dans le dossier sélectionné, il est nécessaire de cliquer sur le bouton ""Créer""", 10)
EndIf
$desfilename = GUICtrlRead($htmLblSource)

;###################################################################
;APERCU
;###################################################################
Case $listener = $ctrlbutton1 Or $listener= $viewitem
Select
Case $name = ""
MsgBox(16, "Erreur", "Aucun Nom n'a été saisi." & @LF & "Saisissez un nom et cliquez sur ""Aperçu""", 5)
Case $surname = ""
MsgBox(16, "Erreur", "Aucun Prénom n'a été saisi." & @LF & "Saisissez un Prénom  et cliquez sur ""Aperçu""", 5)
Case $email2 = "" or $email = ""
MsgBox(16, "Erreur", "E-Mail incomplet." & @LF & "Renseignez votre adresse e-mail complète et cliquez sur ""Aperçu"".", 5)
Case Else
_FileCreate($temp_sign)
Local $intFile
$intFile = FileOpen($temp_sign, 2)
FileWriteLine($intFile, "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">")
FileWriteLine($intFile, "<HTML><HEAD><TITLE>Signature de "&$surname&" "&$name&"</TITLE>")
FileWriteLine($intFile, "<!--NOM:"&$name&"-->")
FileWriteLine($intFile, "<!--PRENOM:"&$surname&"-->")
FileWriteLine($intFile, "<!--TITRE:"&$title&"-->")
FileWriteLine($intFile, "<!--TELEPHONE:"&$phone&"-->")
FileWriteLine($intFile, "<!--FAX:"&$num_fax&"-->")
FileWriteLine($intFile, "<!--MOBILE:"&$gsm&"-->")
FileWriteLine($intFile, "<!--MAIL:"&$email&"-->")
FileWriteLine($intFile, "<!--MAILSUFF:"&$email2&"-->")
FileWriteLine($intFile, "<STYLE>")
FileWriteLine($intFile, ".aaa {FONT-SIZE: 2mm}")
FileWriteLine($intFile, ".a:link {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, ".a:visited {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, ".a:active {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, ".Style1 {font-family:Times New Roman;font-size: 10pt; font-weight:bold;}")
FileWriteLine($intFile, ".Style2 {font-family:Times New Roman;font-size: 9pt; font-style: italic;}")
FileWriteLine($intFile, ".Style3 {font-family:Times New Roman;font-size: 11pt;}")
FileWriteLine($intFile, ".Style4 {font-family:Times New Roman;font-size: 8pt;}")
FileWriteLine($intFile, ".Style5 {font-family:Times New Roman;font-size: 9px; color: #999999;}")
FileWriteLine($intFile, ".Style6 {font-family:Times New Roman;font-size: 10px}")
FileWriteLine($intFile, ".Style7 {font-family:Times New Roman;font-size: 8pt;font-style: italic;}")
FileWriteLine($intFile, ".Style8 {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, "</STYLE></HEAD><BODY>")
FileWriteLine($intFile, "<TABLE width=auto cellSpacing=0 cellPadding=0 border=0>")
FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style1>"&$surname&" "&$name&"</TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style2>"&$title&"</TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style6 align=left><br></TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style3 colspan=2 align=left>Van Cleef & Arpels</TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>31, rue toto 75001 Paris - France</TD></TR>")
If Not $phone = "" Then
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Phone : "&$phone&"</TD></TR>")
EndIf
If Not $num_fax = "" Then
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Fax : "&$num_fax&"</TD></TR>")
EndIf
If Not $gsm = "" Then
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Gsm : "&$gsm&"</TD></TR>")
EndIf
FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=mailto:"&$email&$email2&" title="&$email&$email2&">"&$email&$email2&"</A></TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=http://www.google.com/ TARGET=_blank title=http://www.google.com>http://www.google.com</A></TD></TR>")
FileWriteLine($intFile, "<TR><TD class=Style5><br><br></TD></TR>")
FileWriteLine($intFile, "<TR><td class=Style4>REJOIGNEZ NOUS SUR FACEBOOK: <A href=http://www.facebook.com title=http://www.facebook.com TARGET=_blank class=Style8>http://www.facebook.com</A></TD>")
FileWriteLine($intFile, "<TR><td class=Style4>SUIVEZ NOUS SUR TWITTER: <A href=http://twitter.com title=http://twitter.com TARGET=_blank class=Style8>http://twitter.com</A></TD></TR>")
FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
FileWriteLine($intFile, "<TR><td class=Style2>Help save paper - do you need to print this email?</TD></TR>")
FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
FileWriteLine($intFile, "<TR><td class=Style7>CONFIDENTIAL :This message contains confidential information and is intended solely and exclusively for the use of its addressee(s). Any unauthorized copy or disclosure of its contents to any other person is strictly prohibited. If you are not the intended recipient of this message, kindly notify the sender immediately and delete this message and any attachments without retaining a copy.</TD></TR>")
FileWriteLine($intFile, "</TD></TR></TABLE>")
FileWriteLine($intFile, "</BODY></HTML>")
FileClose($intFile)
ShellExecute($temp_sign,0)
EndSelect
;###################################################################
;CREATION
;###################################################################
Case $listener = $ctrlbutton2 Or $listener = $createitem
Select
Case $name = ""
MsgBox(16, "Erreur", "Aucun Nom n'a été saisi." & @LF & "Saisissez un nom et cliquez sur ""Créer""", 5)
Case $surname = ""
MsgBox(16, "Erreur", "Aucun Prénom n'a été saisi." & @LF & "Saisissez un Prénom  et cliquez sur ""Créer""", 5)
Case $email2 = "" or $email = ""
MsgBox(16, "Erreur", "E-Mail incomplet." & @LF & "Renseignez votre adresse e-mail complète et cliquez sur ""Créer"".", 5)
Case $lbl = "Cliquez sur ""Enregistrez sous..."""
MsgBox(16, "Erreur", "Aucune Destination n'a été sélectionnée" & @LF & "Choisissez votre Destination et cliquez sur ""Créer""", 5)
Case Else
$desfilename=GUICtrlRead($htmLblSource)
FileDelete($desfilename)
_FileCreate($desfilename)
Local $intFile
$intFile = FileOpen($desfilename, 2)
FileWriteLine($intFile, "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">")
FileWriteLine($intFile, "<HTML><HEAD><TITLE>"&$surname&" "&$name&" Signature</TITLE>")
FileWriteLine($intFile, "<!--NOM:"&$name&"-->")
FileWriteLine($intFile, "<!--PRENOM:"&$surname&"-->")
FileWriteLine($intFile, "<!--TITRE:"&$title&"-->")
FileWriteLine($intFile, "<!--TELEPHONE:"&$phone&"-->")
FileWriteLine($intFile, "<!--FAX:"&$num_fax&"-->")
FileWriteLine($intFile, "<!--MOBILE:"&$gsm&"-->")
FileWriteLine($intFile, "<!--MAIL:"&$email&"-->")
FileWriteLine($intFile, "<!--MAILSUFF:"&$email2&"-->")
FileWriteLine($intFile, "<STYLE>")
FileWriteLine($intFile, ".aaa {FONT-SIZE: 2mm}")
FileWriteLine($intFile, ".a:link {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, ".a:visited {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, ".a:active {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, ".Style1 {font-family:Times New Roman;font-size: 10pt; font-weight:bold;}")
FileWriteLine($intFile, ".Style2 {font-family:Times New Roman;font-size: 9pt; font-style: italic;}")
FileWriteLine($intFile, ".Style3 {font-family:Times New Roman;font-size: 11pt;}")
FileWriteLine($intFile, ".Style4 {font-family:Times New Roman;font-size: 8pt;}")
FileWriteLine($intFile, ".Style5 {font-family:Times New Roman;font-size: 9px; color: #999999;}")
FileWriteLine($intFile, ".Style6 {font-family:Times New Roman;font-size: 10px}")
FileWriteLine($intFile, ".Style7 {font-family:Times New Roman;font-size: 8pt;font-style: italic;}")
FileWriteLine($intFile, ".Style8 {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, "</STYLE></HEAD><BODY>")
FileWriteLine($intFile, "<TABLE width=auto cellSpacing=0 cellPadding=0 border=0>")
FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style1>"&$surname&" "&$name&"</TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style2>"&$title&"</TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style6 align=left><br></TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style3 colspan=2 align=left>Van Cleef & Arpels</TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>31, rue toto 75001 Paris - France</TD></TR>")
If Not $phone = "" Then
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Phone : "&$phone&"</TD></TR>")
EndIf
If Not $num_fax = "" Then
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Fax : "&$num_fax&"</TD></TR>")
EndIf
If Not $gsm = "" Then
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Gsm : "&$gsm&"</TD></TR>")
EndIf
FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=mailto:"&$email&$email2&" title="&$email&$email2&">"&$email&$email2&"</A></TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=http://www.google.com/ TARGET=_blank title=http://www.google.com>http://www.google.com</A></TD></TR>")
FileWriteLine($intFile, "<TR><TD class=Style5><br><br></TD></TR>")
FileWriteLine($intFile, "<TR><td class=Style4>REJOIGNEZ NOUS SUR FACEBOOK: <A href=http://www.facebook.com title=http://www.facebook.com TARGET=_blank class=Style8>http://www.facebook.com</A></TD>")
FileWriteLine($intFile, "<TR><td class=Style4>SUIVEZ NOUS SUR TWITTER: <A href=http://twitter.com title=http://twitter.com TARGET=_blank class=Style8>http://twitter.com</A></TD></TR>")
FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
FileWriteLine($intFile, "<TR><td class=Style2>Help save paper - do you need to print this email?</TD></TR>")
FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
FileWriteLine($intFile, "<TR><td class=Style7>CONFIDENTIAL :This message contains confidential information and is intended solely and exclusively for the use of its addressee(s). Any unauthorized copy or disclosure of its contents to any other person is strictly prohibited. If you are not the intended recipient of this message, kindly notify the sender immediately and delete this message and any attachments without retaining a copy.</TD></TR>")
FileWriteLine($intFile, "</TD></TR></TABLE>")
FileWriteLine($intFile, "</BODY></HTML>")
FileClose($intFile)
;Message de création
MsgBox(64, " "& StringTrimRight(@ScriptName,4) & " "& $version &"", "Fichier créé et sauvegardé dans " & $desfilename & "")
EndSelect
EndSelect
WEnd
;#####################################################################################
;################################## ENGLISH VERSION ##################################
;#####################################################################################
Case $version="EN"
;Script
$gui = GuiCreate(" "& StringTrimRight(@ScriptName,4) & " "& $version &"", 410, 380, -1, -1,$WS_POPUPWINDOW)
GUISetBkColor(0xD9E3E9)
$logo = @TempDir & "\helpgui\logo.bmp"
GUICtrlCreatePic($logo,135, 320, 0, 0)
; MENU Fichier
$filemenu=GUICtrlCreateMenu ("&File")
$openitem=GUICtrlCreateMenuitem ("Open",$filemenu)
$viewitem=GUICtrlCreateMenuitem ("Preview",$filemenu)
$createitem=GUICtrlCreateMenuitem ("Create",$filemenu)
$resetitem=GUICtrlCreateMenuitem ("Reset",$filemenu)
$exititem=GUICtrlCreateMenuitem ("Exit",$filemenu)
; MENU Aide
$helpmenu=GUICtrlCreateMenu ("&?")
$helpitem=GUICtrlCreateMenuitem ("Help",$helpmenu)
;BOUTONS
$ctrlbutton0=GuiCtrlCreateButton("Open", 18, 280, 70, 20,$BS_FLAT)
$ctrlbutton1=GuiCtrlCreateButton("Preview", 93, 280, 70, 20,$BS_FLAT)
$ctrlbutton2=GuiCtrlCreateButton("Create", 168, 280, 70, 20,$BS_FLAT)
$ctrlbutton3=GuiCtrlCreateButton("Reset", 243, 280, 70, 20,$BS_FLAT)
$ctrlbutton4=GuiCtrlCreateButton("Exit", 318, 280, 70, 20,$BS_FLAT)
;CHAMPS DE SAISIE UTILISATEUR
;Nom
$nomlbl=GUICtrlCreateLabel("Surname :", 10, 32, 57, 20, $SS_RIGHT)
$nom=GUICtrlCreateInput("", 70, 30, 300, 20,$ES_UPPERCASE)
;Prenom
$prenomlbl = GUICtrlCreateLabel("First Name :", 10, 57, 57, 20,$SS_RIGHT)
$prenom = GUICtrlCreateInput("", 70, 55, 300, 20)
;Titre
$titrelbl = GUICtrlCreateLabel("Title :", 10, 82, 57, 20,$SS_RIGHT)
$titre = GUICtrlCreateInput("", 70, 80, 300, 20)
;Telephone
$telephonelbl = GUICtrlCreateLabel("Phone :", 10, 107, 57, 20,$SS_RIGHT)
$telephone = GUICtrlCreateInput("", 70, 105, 300, 20)
;Fax
$faxlbl = GUICtrlCreateLabel("Fax :", 10, 132, 57, 20,$SS_RIGHT)
$fax = GUICtrlCreateInput("", 70, 130, 300, 20)
;Mobile
$mobilelbl = GUICtrlCreateLabel("Gsm :", 10, 157, 57, 20,$SS_RIGHT)
$mobile = GUICtrlCreateInput("", 70, 155, 300, 20)
;E-mail
$maillbl = GUICtrlCreateLabel("E-Mail :", 10, 182, 57, 20, $SS_RIGHT)
$mail = GUICtrlCreateInput("", 70, 180, 150, 20)
$mailsuff = GUICtrlCreateCombo("", 230, 180, 140, 20)
GUICtrlSetData($mailsuff,"@toto.com|@tata.com|@titi.com|@tutu.com")
;Sauvegarde
$htmLblSource = GUICtrlCreateInput("Click on ""Save as...""", 25, 240, 270, 20)
$htmsaveSource = GUICtrlCreateButton("Save as...", 300, 240, 95, 20,$BS_FLAT)
GUIDelete($recup_info)
GUISetState(@SW_SHOW,$gui)

While 1
$listener = GUIGetMsg()
;VARIABLES
$name=GUICtrlRead($nom)
$surname=GUICtrlRead($prenom)
$surname=StringUpper(StringMid($surname,1,1)) & StringMid($surname,2,StringLen($surname) - 1)
$prenom_2=GUICtrlSetData($prenom, $surname, "")
$title=GUICtrlRead($titre)
$phone=GUICtrlRead($telephone)
$num_fax=GUICtrlRead($fax)
$gsm=GUICtrlRead($mobile)
$email=GUICtrlRead($mail)
$email2=GUICtrlRead($mailsuff)
$lbl=GUICtrlRead($htmLblSource)
$temp_sign=@TempDir & "\_Signature "& $surname &" "& $name &".htm"
$temp_help=@TempDir & "\helpgui\Signature_Introduction.html"
Select
;Fermeture
Case $listener = $GUI_EVENT_PRIMARYDOWN
accent()

Case $listener = $GUI_EVENT_CLOSE Or $listener = $exititem Or $listener = $ctrlbutton4
If FileExists(@TempDir & "\_Signature *.*") Then
FileDelete(@TempDir & "\_Signature *.*")
EndIf
DirRemove(@TempDir & "\helpgui", 1) 
ExitLoop
;Reset
Case $listener=$resetitem or $listener=$ctrlbutton3
GUICtrlSetData($nom,$blank)
GUICtrlSetData($prenom,$blank)
GUICtrlSetData($titre,$blank)
GUICtrlSetData($telephone,$blank)
GUICtrlSetData($fax,$blank)
GUICtrlSetData($mobile,$blank)
GUICtrlSetData($mail,$blank)
GUICtrlSetData($mailsuff,$blank)
GUICtrlSetData($mailsuff,"@toto.com|@tata.com|@titi.com|@tutu.com")
GUICtrlSetData($htmLblSource,"Click on ""Save as...""")
;Ouvrir
Case $listener=$openitem or $listener=$ctrlbutton0
$file=FileOpenDialog("Select your signature file", @MyDocumentsDir,"Documents HTM (*.htm)",0)
FileOpen($file,0)
;Lecture NOM
$nomread=FileReadLine($file, 3)
$nomread = StringReplace(StringReplace($nomread, "<!--NOM:", ""), "-->", "")
GUICtrlSetData($nom,$nomread)
;Lecture PRENOM
$prenomread=FileReadLine($file, 4)
$prenomread = StringReplace(StringReplace($prenomread, "<!--PRENOM:", ""), "-->", "")
GUICtrlSetData($prenom,$prenomread)
;Lecture TITRE
$titreread=FileReadLine($file, 5)
$titreread = StringReplace(StringReplace($titreread, "<!--TITRE:", ""), "-->", "")
GUICtrlSetData($titre,$titreread)
;Lecture TELEPHONE
$telephoneread=FileReadLine($file, 6)
$telephoneread = StringReplace(StringReplace($telephoneread, "<!--TELEPHONE:", ""), "-->", "")
GUICtrlSetData($telephone,$telephoneread)
;Lecture FAX
$faxread=FileReadLine($file, 7)
$faxread = StringReplace(StringReplace($faxread, "<!--FAX:", ""), "-->", "")
GUICtrlSetData($fax,$faxread)
;Lecture MOBILE
$mobileread=FileReadLine($file, 8)
$mobileread = StringReplace(StringReplace($mobileread, "<!--MOBILE:", ""), "-->", "")
GUICtrlSetData($mobile,$mobileread)
;Lecture MAIL
$mailread=FileReadLine($file, 9)
$mailread = StringReplace(StringReplace($mailread, "<!--MAIL:", ""), "-->", "")
GUICtrlSetData($mail,$mailread)
$mailsuffread=FileReadLine($file, 10)
$mailsuffread = StringReplace(StringReplace($mailsuffread, "<!--MAILSUFF:", ""), "-->", "")
GUICtrlSetData($mailsuff,$mailsuffread)
;Emplacement FICHIER
GUICtrlSetData($htmLblSource,$file)
FileClose($file)
;Aide
Case $listener= $helpitem
ShellExecute($temp_help,0)
;Selection du nom de fichier et dossier de destination
Case $listener = $htmsaveSource
GUICtrlSetData($htmLblSource, FileSaveDialog("Selectionnez la destination du fichier htm", @MyDocumentsDir, "Documents HTM (*.htm)"))
$filedir = GUICtrlSetData($htmLblSource,StringReplace(GUICtrlRead($htmLblSource) & ".htm", "vbs", "htm"))
$dest = GUICtrlRead($htmLblSource)
result($dest)
If $var=".htm" Then
GUICtrlSetData($htmLblSource,"Click on ""Save as...""")
Else
GUICtrlSetData($htmLblSource,$var)
MsgBox(64, "Information", "To create your signature in your selected directory, you must click on ""Create""", 10)
EndIf
$desfilename = GUICtrlRead($htmLblSource)

;###################################################################
;APERCU
;###################################################################
Case $listener = $ctrlbutton1 Or $listener= $viewitem
Select
Case $name = ""
MsgBox(16, "Error", "No surname was registered." & @LF & "Please, register a surname then click on ""Preview"".", 5)
Case $surname = ""
MsgBox(16, "Error", "No firstname was registered." & @LF & "Please, register a firstname then click on ""Preview"".", 5)
Case $email2 = "" or $email = ""
MsgBox(16, "Error", "Incomplete E-Mail." & @LF & "Please register your complete e-mail then click on ""Preview"".", 5)
Case Else
_FileCreate($temp_sign)
Local $intFile
$intFile = FileOpen($temp_sign, 2)
FileWriteLine($intFile, "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">")
FileWriteLine($intFile, "<HTML><HEAD><TITLE>Signature de "&$surname&" "&$name&"</TITLE>")
FileWriteLine($intFile, "<!--NOM:"&$name&"-->")
FileWriteLine($intFile, "<!--PRENOM:"&$surname&"-->")
FileWriteLine($intFile, "<!--TITRE:"&$title&"-->")
FileWriteLine($intFile, "<!--TELEPHONE:"&$phone&"-->")
FileWriteLine($intFile, "<!--FAX:"&$num_fax&"-->")
FileWriteLine($intFile, "<!--MOBILE:"&$gsm&"-->")
FileWriteLine($intFile, "<!--MAIL:"&$email&"-->")
FileWriteLine($intFile, "<!--MAILSUFF:"&$email2&"-->")
FileWriteLine($intFile, "<STYLE>")
FileWriteLine($intFile, ".aaa {FONT-SIZE: 2mm}")
FileWriteLine($intFile, ".a:link {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, ".a:visited {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, ".a:active {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, ".Style1 {font-family:Times New Roman;font-size: 10pt; font-weight:bold;}")
FileWriteLine($intFile, ".Style2 {font-family:Times New Roman;font-size: 9pt; font-style: italic;}")
FileWriteLine($intFile, ".Style3 {font-family:Times New Roman;font-size: 11pt;}")
FileWriteLine($intFile, ".Style4 {font-family:Times New Roman;font-size: 8pt;}")
FileWriteLine($intFile, ".Style5 {font-family:Times New Roman;font-size: 9px; color: #999999;}")
FileWriteLine($intFile, ".Style6 {font-family:Times New Roman;font-size: 10px}")
FileWriteLine($intFile, ".Style7 {font-family:Times New Roman;font-size: 8pt;font-style: italic;}")
FileWriteLine($intFile, ".Style8 {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, "</STYLE></HEAD><BODY>")
FileWriteLine($intFile, "<TABLE width=auto cellSpacing=0 cellPadding=0 border=0>")
FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style1>"&$surname&" "&$name&"</TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style2>"&$title&"</TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style6 align=left><br></TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style3 colspan=2 align=left>Van Cleef & Arpels</TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>31, rue toto 75001 Paris - France</TD></TR>")
If Not $phone = "" Then
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Phone : "&$phone&"</TD></TR>")
EndIf
If Not $num_fax = "" Then
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Fax : "&$num_fax&"</TD></TR>")
EndIf
If Not $gsm = "" Then
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Gsm : "&$gsm&"</TD></TR>")
EndIf
FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=mailto:"&$email&$email2&" title="&$email&$email2&">"&$email&$email2&"</A></TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=http://www.google.com/ TARGET=_blank title=http://www.google.com>http://www.google.com</A></TD></TR>")
FileWriteLine($intFile, "<TR><TD class=Style5><br><br></TD></TR>")
FileWriteLine($intFile, "<TR><td class=Style4>REJOIGNEZ NOUS SUR FACEBOOK: <A href=http://www.facebook.com title=http://www.facebook.com TARGET=_blank class=Style8>http://www.facebook.com</A></TD>")
FileWriteLine($intFile, "<TR><td class=Style4>SUIVEZ NOUS SUR TWITTER: <A href=http://twitter.com title=http://twitter.com TARGET=_blank class=Style8>http://twitter.com</A></TD></TR>")
FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
FileWriteLine($intFile, "<TR><td class=Style2>Help save paper - do you need to print this email?</TD></TR>")
FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
FileWriteLine($intFile, "<TR><td class=Style7>CONFIDENTIAL :This message contains confidential information and is intended solely and exclusively for the use of its addressee(s). Any unauthorized copy or disclosure of its contents to any other person is strictly prohibited. If you are not the intended recipient of this message, kindly notify the sender immediately and delete this message and any attachments without retaining a copy.</TD></TR>")
FileWriteLine($intFile, "</TD></TR></TABLE>")
FileWriteLine($intFile, "</BODY></HTML>")
FileClose($intFile)
ShellExecute($temp_sign,0)
EndSelect
;###################################################################
;CREATION
;###################################################################
Case $listener = $ctrlbutton2 Or $listener = $createitem
Select
Case $name = ""
MsgBox(16, "Error", "No surname was registered." & @LF & "Please, register a surname then click on ""Create"".", 5)
Case $surname = ""
MsgBox(16, "Error", "No firstname was registered." & @LF & "Please, register a firstname then click on ""Create"".", 5)
Case $email2 = "" or $email = ""
MsgBox(16, "Error", "Incomplete E-Mail." & @LF & "Please register your complete e-mail then click on ""Create"".", 5)
Case $lbl = "Click on ""Save as..."""
MsgBox(16, "Error", "No file destination was selected" & @LF & "Please, choose a destination then click ""Create"".", 5)
Case Else
$m1="Creation in progress..."
FileDelete($desfilename)
_FileCreate($desfilename)
Local $intFile
$intFile = FileOpen($desfilename, 2)
FileWriteLine($intFile, "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">")
FileWriteLine($intFile, "<HTML><HEAD><TITLE>"&$surname&" "&$name&" Signature</TITLE>")
FileWriteLine($intFile, "<!--NOM:"&$name&"-->")
FileWriteLine($intFile, "<!--PRENOM:"&$surname&"-->")
FileWriteLine($intFile, "<!--TITRE:"&$title&"-->")
FileWriteLine($intFile, "<!--TELEPHONE:"&$phone&"-->")
FileWriteLine($intFile, "<!--FAX:"&$num_fax&"-->")
FileWriteLine($intFile, "<!--MOBILE:"&$gsm&"-->")
FileWriteLine($intFile, "<!--MAIL:"&$email&"-->")
FileWriteLine($intFile, "<!--MAILSUFF:"&$email2&"-->")
FileWriteLine($intFile, "<STYLE>")
FileWriteLine($intFile, ".aaa {FONT-SIZE: 2mm}")
FileWriteLine($intFile, ".a:link {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, ".a:visited {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, ".a:active {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, ".Style1 {font-family:Times New Roman;font-size: 10pt; font-weight:bold;}")
FileWriteLine($intFile, ".Style2 {font-family:Times New Roman;font-size: 9pt; font-style: italic;}")
FileWriteLine($intFile, ".Style3 {font-family:Times New Roman;font-size: 11pt;}")
FileWriteLine($intFile, ".Style4 {font-family:Times New Roman;font-size: 8pt;}")
FileWriteLine($intFile, ".Style5 {font-family:Times New Roman;font-size: 9px; color: #999999;}")
FileWriteLine($intFile, ".Style6 {font-family:Times New Roman;font-size: 10px}")
FileWriteLine($intFile, ".Style7 {font-family:Times New Roman;font-size: 8pt;font-style: italic;}")
FileWriteLine($intFile, ".Style8 {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
FileWriteLine($intFile, "</STYLE></HEAD><BODY>")
FileWriteLine($intFile, "<TABLE width=auto cellSpacing=0 cellPadding=0 border=0>")
FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style1>"&$surname&" "&$name&"</TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style2>"&$title&"</TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style6 align=left><br></TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style3 colspan=2 align=left>Van Cleef & Arpels</TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>31, rue toto 75001 Paris - France</TD></TR>")
If Not $phone = "" Then
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Phone : "&$phone&"</TD></TR>")
EndIf
If Not $num_fax = "" Then
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Fax : "&$num_fax&"</TD></TR>")
EndIf
If Not $gsm = "" Then
FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Gsm : "&$gsm&"</TD></TR>")
EndIf
FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=mailto:"&$email&$email2&" title="&$email&$email2&">"&$email&$email2&"</A></TD></TR>")
FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=http://www.google.com/ TARGET=_blank title=http://www.google.com>http://www.google.com</A></TD></TR>")
FileWriteLine($intFile, "<TR><TD class=Style5><br><br></TD></TR>")
FileWriteLine($intFile, "<TR><td class=Style4>REJOIGNEZ NOUS SUR FACEBOOK: <A href=http://www.facebook.com title=http://www.facebook.com TARGET=_blank class=Style8>http://www.facebook.com</A></TD>")
FileWriteLine($intFile, "<TR><td class=Style4>SUIVEZ NOUS SUR TWITTER: <A href=http://twitter.com title=http://twitter.com TARGET=_blank class=Style8>http://twitter.com</A></TD></TR>")
FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
FileWriteLine($intFile, "<TR><td class=Style2>Help save paper - do you need to print this email?</TD></TR>")
FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
FileWriteLine($intFile, "<TR><td class=Style7>CONFIDENTIAL :This message contains confidential information and is intended solely and exclusively for the use of its addressee(s). Any unauthorized copy or disclosure of its contents to any other person is strictly prohibited. If you are not the intended recipient of this message, kindly notify the sender immediately and delete this message and any attachments without retaining a copy.</TD></TR>")
FileWriteLine($intFile, "</TD></TR></TABLE>")
FileWriteLine($intFile, "</BODY></HTML>")
FileClose($intFile)
;Message de création
MsgBox(64, " "& StringTrimRight(@ScriptName,4) & " "& $version &"", "File created and saved in " & $desfilename & "")
EndSelect
EndSelect
WEnd
EndSelect


Func accent()
For $i = 0 to 6
;Libellé interne
$surname = StringRegExpReplace($surname, $aConvert[$i][0], $aConvert[$i][1])
$name = StringRegExpReplace($name, $aConvert[$i][0], $aConvert[$i][1])
$email=GUICtrlSetData($mail, StringReplace(StringLower($surname)&"."&StringLower($name)," ","-"))
Next
EndFunc

Func result($dest)
$result=StringRight($dest, 8)
Select
Case $result=".htm.htm"
$var=StringTrimRight($dest, 4)
Case Else
$var=$dest
EndSelect
EndFunc
Edited by lafafmentvotre

Share this post


Link to post
Share on other sites
lafafmentvotre

Nobody can help me please ??

helppppppppp

Share this post


Link to post
Share on other sites
AlmarM

What exactly doenst work?

What I did:

Open > English Version > Typ some information > Save As... > Create > Exit > Start > Open > Modify > Create.

Works for me.


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
lafafmentvotre

Hi AlmarM

Thanks for you response

I did the same thing

Open > English Version > Type some information > Save As... > Create > Exit > Works fine

Start > English Version > Open > Modify > Preview > Works fine

Start > English Version > Open > Modify > Create > Doesn't works

????????

Share this post


Link to post
Share on other sites
AlmarM

Hi AlmarM

Thanks for you response

I did the same thing

Open > English Version > Type some information > Save As... > Create > Exit > Works fine

Start > English Version > Open > Modify > Preview > Works fine

Start > English Version > Open > Modify > Create > Doesn't works

????????

Still works for me... I guess :mellow:

Could you show us your error?

Edited by AlmarM

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
lafafmentvotre

No error

The msgbox say "File created" but the html file is not modified

Share this post


Link to post
Share on other sites
AlmarM

No error

The msgbox say "File created" but the html file is not modified

Ah, I misunderstood!

I thought you were getting a error. I dont have time to search trough your whole code, but you could try deleting the file before writing it again.


Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Share this post


Link to post
Share on other sites
lafafmentvotre

Hello

I write this in my script (part French Creation) but the file was not deleted

;###################################################################
;CREATION
;###################################################################
Case $listener = $ctrlbutton2 Or $listener = $createitem
Select
Case $name = ""
MsgBox(16, "Erreur", "Aucun Nom n'a été saisi." & @LF & "Saisissez un nom et cliquez sur ""Créer""", 5)
Case $surname = ""
MsgBox(16, "Erreur", "Aucun Prénom n'a été saisi." & @LF & "Saisissez un Prénom  et cliquez sur ""Créer""", 5)
Case $email2 = "" or $email = ""
MsgBox(16, "Erreur", "E-Mail incomplet." & @LF & "Renseignez votre adresse e-mail complète et cliquez sur ""Créer"".", 5)
Case $lbl = "Cliquez sur ""Enregistrez sous..."""
MsgBox(16, "Erreur", "Aucune Destination n'a été sélectionnée" & @LF & "Choisissez votre Destination et cliquez sur ""Créer""", 5)
Case Else
$desfilename=GUICtrlRead($htmLblSource)
FileDelete($desfilename)
_FileCreate($desfilename)
Local $intFile
$intFile = FileOpen($desfilename, 2).....

When i write little script with just a delete file on my $desfilename, the file is deleted.

I test the script with autoit 3.3.6.0 but the file can't be deleted or write/erase with Fileopen($desfilename,2)

What's wrong with this fucking script

Thank's for help

Share this post


Link to post
Share on other sites
lafafmentvotre

Sorry

I'm relax (arggggggggggggghhhhhhhhhhhhhhhhhhhh)

Share this post


Link to post
Share on other sites
Jos

You need to test the returncode of the FileDelete() statement to ensure it worked.

It could fail for different reasons for example when the file is open or the workingdirectory changed..


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
lafafmentvotre

Error code 0

But if i change directory to Desktop, for example, i can :

Start > Open > Modify > Create

????????????

Share this post


Link to post
Share on other sites
Jos

No idea what you are talking about.

Can you show a small script that will demonstrate your problem?


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
lafafmentvotre

My script is on the first post.

The savedialog is fixed on @MyDocumentsDir.

If i open the script, open my file wich is in @MyDesktopDir, modify my file in the same directory and save it > it's work fine

but i open the script, open my file wich is in @MyDocumentsDir, modify my file in the same directory and save it > it doesn't work

Could you help me with this information ??

Thanks

Share this post


Link to post
Share on other sites
Jos

Well, the script in the first post doesn't contain this delete and I am a bad guesser.

So post a small example of the steps you described in your last post that shows the issue.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
lafafmentvotre

SOrry JOS, but i can't post a "small" exemple of the steps.

Share this post


Link to post
Share on other sites
Jos

SOrry JOS, but i can't post a "small" exemple of the steps.

I am not yet clairvoyant so how am I or anybody else able to help you unless we are able replicate the issue and debug it?

We will need a script we can run for that.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
lafafmentvotre

I understand your request but understand me.

The script on the first post can be run, do you want the same in a au3 file ?

Share this post


Link to post
Share on other sites
Bowmore

I have only change the English version where I found 2 errors. You will need to make the same changes to the French section of the script.

The first was when loading an existing file you used fileOpen() but did not save or use the file handle so the file was never closed therefore preventing it from being opened for writing.

The second error was that the contents of the filename control were not being read if the user did not use the Save As button.

Break(1)
;###################################################################
;AutoIT Variables
#include <GuiConstants.au3>
#include <GUIConstantsEx.au3>
#include <File.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <EditConstants.au3>
#include <Excel.au3>
;###################################################################
;Script Variables
Local $blank = ""
Local $aConvert[9][2] = [["[àáâãäåÀÁÂÃÄÅ]", "a"],["[éèêëÈÉÊË]", "e"],["[ìíîï]", "i"],["[çÇ]", "c"],["[ ]", "-"],["ñ", "n"],["[òóôõö]", "o"],["[ùúûüÙÚÛÜ]", "u"],["[ýÿ]", "y"]]
Local $file, $mail, $htmLblSource, $ID_add, $ID_rs, $ID_logo, $rs1, $rs2, $rs3, $rs4, $rs5, $filedir, $var, $fr_version, $en_version, $version, $desfilename
$version = "V1.0"
;###################################################################
;Installation fichiers locaux
DirCreate(@TempDir & "\helpgui")
DirCreate(@TempDir & "\helpgui\helpgui_fichiers")
FileInstall("helpgui\Signature_Introduction.html", @TempDir & "\helpgui\Signature_Introduction.html", 1)
FileInstall("helpgui\Signature_Description.html", @TempDir & "\helpgui\Signature_Description.html", 1)
FileInstall("helpgui\Signature_Creation.html", @TempDir & "\helpgui\Signature_Creation.html", 1)
FileInstall("helpgui\Signature_Modification.html", @TempDir & "\helpgui\Signature_Modification.html", 1)
FileInstall("helpgui\Signature_CSS.css", @TempDir & "\helpgui\Signature_CSS.css", 1)
FileInstall("helpgui\helpgui_fichiers\filelist.xml", @TempDir & "\helpgui\helpgui_fichiers\filelist.xml", 1)
FileInstall("helpgui\helpgui_fichiers\image001.jpg", @TempDir & "\helpgui\helpgui_fichiers\image001.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image002.jpg", @TempDir & "\helpgui\helpgui_fichiers\image002.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image003.jpg", @TempDir & "\helpgui\helpgui_fichiers\image003.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image004.jpg", @TempDir & "\helpgui\helpgui_fichiers\image004.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image005.jpg", @TempDir & "\helpgui\helpgui_fichiers\image005.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image006.jpg", @TempDir & "\helpgui\helpgui_fichiers\image006.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image007.jpg", @TempDir & "\helpgui\helpgui_fichiers\image007.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image008.jpg", @TempDir & "\helpgui\helpgui_fichiers\image008.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image009.jpg", @TempDir & "\helpgui\helpgui_fichiers\image009.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image010.jpg", @TempDir & "\helpgui\helpgui_fichiers\image010.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image011.jpg", @TempDir & "\helpgui\helpgui_fichiers\image011.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image012.jpg", @TempDir & "\helpgui\helpgui_fichiers\image012.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image013.jpg", @TempDir & "\helpgui\helpgui_fichiers\image013.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image014.jpg", @TempDir & "\helpgui\helpgui_fichiers\image014.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image015.jpg", @TempDir & "\helpgui\helpgui_fichiers\image015.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image016.jpg", @TempDir & "\helpgui\helpgui_fichiers\image016.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image017.jpg", @TempDir & "\helpgui\helpgui_fichiers\image017.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image018.jpg", @TempDir & "\helpgui\helpgui_fichiers\image018.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image019.jpg", @TempDir & "\helpgui\helpgui_fichiers\image019.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image020.jpg", @TempDir & "\helpgui\helpgui_fichiers\image020.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image021.jpg", @TempDir & "\helpgui\helpgui_fichiers\image021.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image022.jpg", @TempDir & "\helpgui\helpgui_fichiers\image022.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image023.jpg", @TempDir & "\helpgui\helpgui_fichiers\image023.jpg", 1)
FileInstall("helpgui\helpgui_fichiers\image024.jpg", @TempDir & "\helpgui\helpgui_fichiers\image024.jpg", 1)
FileInstall("logo.bmp", @TempDir & "\helpgui\logo.bmp", 1)
;LANGUAGE
$recup_info = GUICreate("", 300, 50, -1, -1, $WS_POPUPWINDOW)
$fr_version = GUICtrlCreateRadio("Version Française", 40, 15, 110, 20)
$en_version = GUICtrlCreateRadio("English Version", 160, 15, 100, 20)
GUISetState(@SW_SHOW, $recup_info)
While 1
    $listener = GUIGetMsg()
    Select
        Case $listener = $fr_version
            $version = "FR"
            ExitLoop
        Case $listener = $en_version
            $version = "EN"
            ExitLoop
    EndSelect
WEnd

Select
    ;#####################################################################################
    ;################################## FRENCH VERSION ###################################
    ;#####################################################################################
    Case $version = "FR"
        ;Script
        $gui = GUICreate(" " & StringTrimRight(@ScriptName, 4) & " " & $version & "", 410, 380, -1, -1, $WS_POPUPWINDOW)
        GUISetBkColor(0xD9E3E9)
        $logo = @TempDir & "\helpgui\logo.bmp"
        GUICtrlCreatePic($logo, 135, 320, 0, 0)
        ; MENU Fichier
        $filemenu = GUICtrlCreateMenu("&Fichier")
        $openitem = GUICtrlCreateMenuItem("Ouvrir", $filemenu)
        $viewitem = GUICtrlCreateMenuItem("Aperçu", $filemenu)
        $createitem = GUICtrlCreateMenuItem("Créer", $filemenu)
        $resetitem = GUICtrlCreateMenuItem("Réinitialiser", $filemenu)
        $exititem = GUICtrlCreateMenuItem("Quitter", $filemenu)
        ; MENU Aide
        $helpmenu = GUICtrlCreateMenu("&?")
        $helpitem = GUICtrlCreateMenuItem("Aide", $helpmenu)
        ;BOUTONS
        $ctrlbutton0 = GUICtrlCreateButton("Ouvrir", 18, 280, 70, 20, $BS_FLAT)
        $ctrlbutton1 = GUICtrlCreateButton("Aperçu", 93, 280, 70, 20, $BS_FLAT)
        $ctrlbutton2 = GUICtrlCreateButton("Créer", 168, 280, 70, 20, $BS_FLAT)
        $ctrlbutton3 = GUICtrlCreateButton("Réinitialiser", 243, 280, 70, 20, $BS_FLAT)
        $ctrlbutton4 = GUICtrlCreateButton("Quitter", 318, 280, 70, 20, $BS_FLAT)
        ;CHAMPS DE SAISIE UTILISATEUR
        ;Nom
        $nomlbl = GUICtrlCreateLabel("Nom :", 10, 32, 57, 20, $SS_RIGHT)
        $nom = GUICtrlCreateInput("", 70, 30, 300, 20, $ES_UPPERCASE)
        ;Prenom
        $prenomlbl = GUICtrlCreateLabel("Prénom :", 10, 57, 57, 20, $SS_RIGHT)
        $prenom = GUICtrlCreateInput("", 70, 55, 300, 20)
        ;Titre
        $titrelbl = GUICtrlCreateLabel("Titre :", 10, 82, 57, 20, $SS_RIGHT)
        $titre = GUICtrlCreateInput("", 70, 80, 300, 20)
        ;Telephone
        $telephonelbl = GUICtrlCreateLabel("Tel :", 10, 107, 57, 20, $SS_RIGHT)
        $telephone = GUICtrlCreateInput("", 70, 105, 300, 20)
        ;Fax
        $faxlbl = GUICtrlCreateLabel("Fax :", 10, 132, 57, 20, $SS_RIGHT)
        $fax = GUICtrlCreateInput("", 70, 130, 300, 20)
        ;Mobile
        $mobilelbl = GUICtrlCreateLabel("Gsm :", 10, 157, 57, 20, $SS_RIGHT)
        $mobile = GUICtrlCreateInput("", 70, 155, 300, 20)
        ;E-mail
        $maillbl = GUICtrlCreateLabel("E-Mail :", 10, 182, 57, 20, $SS_RIGHT)
        $mail = GUICtrlCreateInput("", 70, 180, 150, 20)
        $mailsuff = GUICtrlCreateCombo("", 230, 180, 140, 20)
        GUICtrlSetData($mailsuff, "@toto.com|@tata.com|@titi.com|@tutu.com")
        ;Sauvegarde
        $htmLblSource = GUICtrlCreateInput("Cliquez sur ""Enregistrez sous...""", 25, 240, 270, 20)
        $htmsaveSource = GUICtrlCreateButton("Enregistrez sous...", 300, 240, 95, 20, $BS_FLAT)
        GUIDelete($recup_info)
        GUISetState(@SW_SHOW, $gui)

        While 1
            $listener = GUIGetMsg()
            ;VARIABLES
            $name = GUICtrlRead($nom)
            $surname = GUICtrlRead($prenom)
            $surname = StringUpper(StringMid($surname, 1, 1)) & StringMid($surname, 2, StringLen($surname) - 1)
            $prenom_2 = GUICtrlSetData($prenom, $surname, "")
            $title = GUICtrlRead($titre)
            $phone = GUICtrlRead($telephone)
            $num_fax = GUICtrlRead($fax)
            $gsm = GUICtrlRead($mobile)
            $email = GUICtrlRead($mail)
            $email2 = GUICtrlRead($mailsuff)
            $lbl = GUICtrlRead($htmLblSource)
            $temp_sign = @TempDir & "\_Signature " & $surname & " " & $name & ".htm"
            $temp_help = @TempDir & "\helpgui\Signature_Introduction.html"
            Select
                ;Fermeture
                Case $listener = $GUI_EVENT_PRIMARYDOWN
                    accent()

                Case $listener = $GUI_EVENT_CLOSE Or $listener = $exititem Or $listener = $ctrlbutton4
                    If FileExists(@TempDir & "\_Signature *.*") Then
                        FileDelete(@TempDir & "\_Signature *.*")
                    EndIf
                    DirRemove(@TempDir & "\helpgui", 1)
                    ExitLoop
                    ;Reset
                Case $listener = $resetitem Or $listener = $ctrlbutton3
                    GUICtrlSetData($nom, $blank)
                    GUICtrlSetData($prenom, $blank)
                    GUICtrlSetData($titre, $blank)
                    GUICtrlSetData($telephone, $blank)
                    GUICtrlSetData($fax, $blank)
                    GUICtrlSetData($mobile, $blank)
                    GUICtrlSetData($mail, $blank)
                    GUICtrlSetData($mailsuff, $blank)
                    GUICtrlSetData($mailsuff, "@toto.com|@tata.com|@titi.com|@tutu.com")
                    GUICtrlSetData($htmLblSource, "Cliquez sur ""Enregistrez sous...""")
                    ;Ouvrir
                Case $listener = $openitem Or $listener = $ctrlbutton0
                    $file = FileOpenDialog("Selectionnez votre fichier signature", @MyDocumentsDir, "Documents HTM (*.htm)", 0)
                    FileOpen($file, 0)
                    ;Lecture NOM
                    $nomread = FileReadLine($file, 3)
                    $nomread = StringReplace(StringReplace($nomread, "<!--NOM:", ""), "-->", "")
                    GUICtrlSetData($nom, $nomread)
                    ;Lecture PRENOM
                    $prenomread = FileReadLine($file, 4)
                    $prenomread = StringReplace(StringReplace($prenomread, "<!--PRENOM:", ""), "-->", "")
                    GUICtrlSetData($prenom, $prenomread)
                    ;Lecture TITRE
                    $titreread = FileReadLine($file, 5)
                    $titreread = StringReplace(StringReplace($titreread, "<!--TITRE:", ""), "-->", "")
                    GUICtrlSetData($titre, $titreread)
                    ;Lecture TELEPHONE
                    $telephoneread = FileReadLine($file, 6)
                    $telephoneread = StringReplace(StringReplace($telephoneread, "<!--TELEPHONE:", ""), "-->", "")
                    GUICtrlSetData($telephone, $telephoneread)
                    ;Lecture FAX
                    $faxread = FileReadLine($file, 7)
                    $faxread = StringReplace(StringReplace($faxread, "<!--FAX:", ""), "-->", "")
                    GUICtrlSetData($fax, $faxread)
                    ;Lecture MOBILE
                    $mobileread = FileReadLine($file, 8)
                    $mobileread = StringReplace(StringReplace($mobileread, "<!--MOBILE:", ""), "-->", "")
                    GUICtrlSetData($mobile, $mobileread)
                    ;Lecture MAIL
                    $mailread = FileReadLine($file, 9)
                    $mailread = StringReplace(StringReplace($mailread, "<!--MAIL:", ""), "-->", "")
                    GUICtrlSetData($mail, $mailread)
                    $mailsuffread = FileReadLine($file, 10)
                    $mailsuffread = StringReplace(StringReplace($mailsuffread, "<!--MAILSUFF:", ""), "-->", "")
                    GUICtrlSetData($mailsuff, $mailsuffread)
                    ;Emplacement FICHIER
                    GUICtrlSetData($htmLblSource, $file)
                    FileClose($file)
                    ;Aide
                Case $listener = $helpitem
                    ShellExecute($temp_help, 0)
                    ;Selection du nom de fichier et dossier de destination
                Case $listener = $htmsaveSource
                    GUICtrlSetData($htmLblSource, FileSaveDialog("Selectionnez la destination du fichier htm", @MyDocumentsDir, "Documents HTM (*.htm)"))
                    $filedir = GUICtrlSetData($htmLblSource, StringReplace(GUICtrlRead($htmLblSource) & ".htm", "vbs", "htm"))
                    $dest = GUICtrlRead($htmLblSource)
                    result($dest)
                    If $var = ".htm" Then
                        GUICtrlSetData($htmLblSource, "Cliquez sur ""Enregistrez sous...""")
                    Else
                        GUICtrlSetData($htmLblSource, $var)
                        MsgBox(64, "Information", "Pour que votre signature soit créée dans le dossier sélectionné, il est nécessaire de cliquer sur le bouton ""Créer""", 10)
                    EndIf
                    $desfilename = GUICtrlRead($htmLblSource)

                    ;###################################################################
                    ;APERCU
                    ;###################################################################
                Case $listener = $ctrlbutton1 Or $listener = $viewitem
                    Select
                        Case $name = ""
                            MsgBox(16, "Erreur", "Aucun Nom n'a été saisi." & @LF & "Saisissez un nom et cliquez sur ""Aperçu""", 5)
                        Case $surname = ""
                            MsgBox(16, "Erreur", "Aucun Prénom n'a été saisi." & @LF & "Saisissez un Prénom  et cliquez sur ""Aperçu""", 5)
                        Case $email2 = "" Or $email = ""
                            MsgBox(16, "Erreur", "E-Mail incomplet." & @LF & "Renseignez votre adresse e-mail complète et cliquez sur ""Aperçu"".", 5)
                        Case Else
                            _FileCreate($temp_sign)
                            Local $intFile
                            $intFile = FileOpen($temp_sign, 2)
                            FileWriteLine($intFile, "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">")
                            FileWriteLine($intFile, "<HTML><HEAD><TITLE>Signature de " & $surname & " " & $name & "</TITLE>")
                            FileWriteLine($intFile, "<!--NOM:" & $name & "-->")
                            FileWriteLine($intFile, "<!--PRENOM:" & $surname & "-->")
                            FileWriteLine($intFile, "<!--TITRE:" & $title & "-->")
                            FileWriteLine($intFile, "<!--TELEPHONE:" & $phone & "-->")
                            FileWriteLine($intFile, "<!--FAX:" & $num_fax & "-->")
                            FileWriteLine($intFile, "<!--MOBILE:" & $gsm & "-->")
                            FileWriteLine($intFile, "<!--MAIL:" & $email & "-->")
                            FileWriteLine($intFile, "<!--MAILSUFF:" & $email2 & "-->")
                            FileWriteLine($intFile, "<STYLE>")
                            FileWriteLine($intFile, ".aaa {FONT-SIZE: 2mm}")
                            FileWriteLine($intFile, ".a:link {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, ".a:visited {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, ".a:active {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, ".Style1 {font-family:Times New Roman;font-size: 10pt; font-weight:bold;}")
                            FileWriteLine($intFile, ".Style2 {font-family:Times New Roman;font-size: 9pt; font-style: italic;}")
                            FileWriteLine($intFile, ".Style3 {font-family:Times New Roman;font-size: 11pt;}")
                            FileWriteLine($intFile, ".Style4 {font-family:Times New Roman;font-size: 8pt;}")
                            FileWriteLine($intFile, ".Style5 {font-family:Times New Roman;font-size: 9px; color: #999999;}")
                            FileWriteLine($intFile, ".Style6 {font-family:Times New Roman;font-size: 10px}")
                            FileWriteLine($intFile, ".Style7 {font-family:Times New Roman;font-size: 8pt;font-style: italic;}")
                            FileWriteLine($intFile, ".Style8 {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, "</STYLE></HEAD><BODY>")
                            FileWriteLine($intFile, "<TABLE width=auto cellSpacing=0 cellPadding=0 border=0>")
                            FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style1>" & $surname & " " & $name & "</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style2>" & $title & "</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style6 align=left><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style3 colspan=2 align=left>Van Cleef & Arpels</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>31, rue toto 75001 Paris - France</TD></TR>")
                            If Not $phone = "" Then
                                FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Phone : " & $phone & "</TD></TR>")
                            EndIf
                            If Not $num_fax = "" Then
                                FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Fax : " & $num_fax & "</TD></TR>")
                            EndIf
                            If Not $gsm = "" Then
                                FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Gsm : " & $gsm & "</TD></TR>")
                            EndIf
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=mailto:" & $email & $email2 & " title=" & $email & $email2 & ">" & $email & $email2 & "</A></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=http://www.google.com/ TARGET=_blank title=http://www.google.com>http://www.google.com</A></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD class=Style5><br><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><td class=Style4>REJOIGNEZ NOUS SUR FACEBOOK: <A href=http://www.facebook.com title=http://www.facebook.com TARGET=_blank class=Style8>http://www.facebook.com</A></TD>")
                            FileWriteLine($intFile, "<TR><td class=Style4>SUIVEZ NOUS SUR TWITTER: <A href=http://twitter.com title=http://twitter.com TARGET=_blank class=Style8>http://twitter.com</A></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><td class=Style2>Help save paper - do you need to print this email?</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><td class=Style7>CONFIDENTIAL :This message contains confidential information and is intended solely and exclusively for the use of its addressee(s). Any unauthorized copy or disclosure of its contents to any other person is strictly prohibited. If you are not the intended recipient of this message, kindly notify the sender immediately and delete this message and any attachments without retaining a copy.</TD></TR>")
                            FileWriteLine($intFile, "</TD></TR></TABLE>")
                            FileWriteLine($intFile, "</BODY></HTML>")
                            FileClose($intFile)
                            ShellExecute($temp_sign, 0)
                    EndSelect
                    ;###################################################################
                    ;CREATION
                    ;###################################################################
                Case $listener = $ctrlbutton2 Or $listener = $createitem
                    Select
                        Case $name = ""
                            MsgBox(16, "Erreur", "Aucun Nom n'a été saisi." & @LF & "Saisissez un nom et cliquez sur ""Créer""", 5)
                        Case $surname = ""
                            MsgBox(16, "Erreur", "Aucun Prénom n'a été saisi." & @LF & "Saisissez un Prénom  et cliquez sur ""Créer""", 5)
                        Case $email2 = "" Or $email = ""
                            MsgBox(16, "Erreur", "E-Mail incomplet." & @LF & "Renseignez votre adresse e-mail complète et cliquez sur ""Créer"".", 5)
                        Case $lbl = "Cliquez sur ""Enregistrez sous..."""
                            MsgBox(16, "Erreur", "Aucune Destination n'a été sélectionnée" & @LF & "Choisissez votre Destination et cliquez sur ""Créer""", 5)
                        Case Else
                            $desfilename = GUICtrlRead($htmLblSource)
                            FileDelete($desfilename)
                            _FileCreate($desfilename)
                            Local $intFile
                            $intFile = FileOpen($desfilename, 2)
                            FileWriteLine($intFile, "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">")
                            FileWriteLine($intFile, "<HTML><HEAD><TITLE>" & $surname & " " & $name & " Signature</TITLE>")
                            FileWriteLine($intFile, "<!--NOM:" & $name & "-->")
                            FileWriteLine($intFile, "<!--PRENOM:" & $surname & "-->")
                            FileWriteLine($intFile, "<!--TITRE:" & $title & "-->")
                            FileWriteLine($intFile, "<!--TELEPHONE:" & $phone & "-->")
                            FileWriteLine($intFile, "<!--FAX:" & $num_fax & "-->")
                            FileWriteLine($intFile, "<!--MOBILE:" & $gsm & "-->")
                            FileWriteLine($intFile, "<!--MAIL:" & $email & "-->")
                            FileWriteLine($intFile, "<!--MAILSUFF:" & $email2 & "-->")
                            FileWriteLine($intFile, "<STYLE>")
                            FileWriteLine($intFile, ".aaa {FONT-SIZE: 2mm}")
                            FileWriteLine($intFile, ".a:link {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, ".a:visited {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, ".a:active {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, ".Style1 {font-family:Times New Roman;font-size: 10pt; font-weight:bold;}")
                            FileWriteLine($intFile, ".Style2 {font-family:Times New Roman;font-size: 9pt; font-style: italic;}")
                            FileWriteLine($intFile, ".Style3 {font-family:Times New Roman;font-size: 11pt;}")
                            FileWriteLine($intFile, ".Style4 {font-family:Times New Roman;font-size: 8pt;}")
                            FileWriteLine($intFile, ".Style5 {font-family:Times New Roman;font-size: 9px; color: #999999;}")
                            FileWriteLine($intFile, ".Style6 {font-family:Times New Roman;font-size: 10px}")
                            FileWriteLine($intFile, ".Style7 {font-family:Times New Roman;font-size: 8pt;font-style: italic;}")
                            FileWriteLine($intFile, ".Style8 {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, "</STYLE></HEAD><BODY>")
                            FileWriteLine($intFile, "<TABLE width=auto cellSpacing=0 cellPadding=0 border=0>")
                            FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style1>" & $surname & " " & $name & "</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style2>" & $title & "</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style6 align=left><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style3 colspan=2 align=left>Van Cleef & Arpels</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>31, rue toto 75001 Paris - France</TD></TR>")
                            If Not $phone = "" Then
                                FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Phone : " & $phone & "</TD></TR>")
                            EndIf
                            If Not $num_fax = "" Then
                                FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Fax : " & $num_fax & "</TD></TR>")
                            EndIf
                            If Not $gsm = "" Then
                                FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Gsm : " & $gsm & "</TD></TR>")
                            EndIf
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=mailto:" & $email & $email2 & " title=" & $email & $email2 & ">" & $email & $email2 & "</A></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=http://www.google.com/ TARGET=_blank title=http://www.google.com>http://www.google.com</A></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD class=Style5><br><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><td class=Style4>REJOIGNEZ NOUS SUR FACEBOOK: <A href=http://www.facebook.com title=http://www.facebook.com TARGET=_blank class=Style8>http://www.facebook.com</A></TD>")
                            FileWriteLine($intFile, "<TR><td class=Style4>SUIVEZ NOUS SUR TWITTER: <A href=http://twitter.com title=http://twitter.com TARGET=_blank class=Style8>http://twitter.com</A></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><td class=Style2>Help save paper - do you need to print this email?</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><td class=Style7>CONFIDENTIAL :This message contains confidential information and is intended solely and exclusively for the use of its addressee(s). Any unauthorized copy or disclosure of its contents to any other person is strictly prohibited. If you are not the intended recipient of this message, kindly notify the sender immediately and delete this message and any attachments without retaining a copy.</TD></TR>")
                            FileWriteLine($intFile, "</TD></TR></TABLE>")
                            FileWriteLine($intFile, "</BODY></HTML>")
                            FileClose($intFile)
                            ;Message de création
                            MsgBox(64, " " & StringTrimRight(@ScriptName, 4) & " " & $version & "", "Fichier créé et sauvegardé dans " & $desfilename & "")
                    EndSelect
            EndSelect
        WEnd
        ;#####################################################################################
        ;################################## ENGLISH VERSION ##################################
        ;#####################################################################################
    Case $version = "EN"
        ;Script
        $gui = GUICreate(" " & StringTrimRight(@ScriptName, 4) & " " & $version & "", 410, 380, -1, -1, $WS_POPUPWINDOW)
        GUISetBkColor(0xD9E3E9)
        $logo = @TempDir & "\helpgui\logo.bmp"
        GUICtrlCreatePic($logo, 135, 320, 0, 0)
        ; MENU Fichier
        $filemenu = GUICtrlCreateMenu("&File")
        $openitem = GUICtrlCreateMenuItem("Open", $filemenu)
        $viewitem = GUICtrlCreateMenuItem("Preview", $filemenu)
        $createitem = GUICtrlCreateMenuItem("Create", $filemenu)
        $resetitem = GUICtrlCreateMenuItem("Reset", $filemenu)
        $exititem = GUICtrlCreateMenuItem("Exit", $filemenu)
        ; MENU Aide
        $helpmenu = GUICtrlCreateMenu("&?")
        $helpitem = GUICtrlCreateMenuItem("Help", $helpmenu)
        ;BOUTONS
        $ctrlbutton0 = GUICtrlCreateButton("Open", 18, 280, 70, 20, $BS_FLAT)
        $ctrlbutton1 = GUICtrlCreateButton("Preview", 93, 280, 70, 20, $BS_FLAT)
        $ctrlbutton2 = GUICtrlCreateButton("Create", 168, 280, 70, 20, $BS_FLAT)
        $ctrlbutton3 = GUICtrlCreateButton("Reset", 243, 280, 70, 20, $BS_FLAT)
        $ctrlbutton4 = GUICtrlCreateButton("Exit", 318, 280, 70, 20, $BS_FLAT)
        ;CHAMPS DE SAISIE UTILISATEUR
        ;Nom
        $nomlbl = GUICtrlCreateLabel("Surname :", 10, 32, 57, 20, $SS_RIGHT)
        $nom = GUICtrlCreateInput("", 70, 30, 300, 20, $ES_UPPERCASE)
        ;Prenom
        $prenomlbl = GUICtrlCreateLabel("First Name :", 10, 57, 57, 20, $SS_RIGHT)
        $prenom = GUICtrlCreateInput("", 70, 55, 300, 20)
        ;Titre
        $titrelbl = GUICtrlCreateLabel("Title :", 10, 82, 57, 20, $SS_RIGHT)
        $titre = GUICtrlCreateInput("", 70, 80, 300, 20)
        ;Telephone
        $telephonelbl = GUICtrlCreateLabel("Phone :", 10, 107, 57, 20, $SS_RIGHT)
        $telephone = GUICtrlCreateInput("", 70, 105, 300, 20)
        ;Fax
        $faxlbl = GUICtrlCreateLabel("Fax :", 10, 132, 57, 20, $SS_RIGHT)
        $fax = GUICtrlCreateInput("", 70, 130, 300, 20)
        ;Mobile
        $mobilelbl = GUICtrlCreateLabel("Gsm :", 10, 157, 57, 20, $SS_RIGHT)
        $mobile = GUICtrlCreateInput("", 70, 155, 300, 20)
        ;E-mail
        $maillbl = GUICtrlCreateLabel("E-Mail :", 10, 182, 57, 20, $SS_RIGHT)
        $mail = GUICtrlCreateInput("", 70, 180, 150, 20)
        $mailsuff = GUICtrlCreateCombo("", 230, 180, 140, 20)
        GUICtrlSetData($mailsuff, "@toto.com|@tata.com|@titi.com|@tutu.com")
        ;Sauvegarde
        $htmLblSource = GUICtrlCreateInput("Click on ""Save as...""", 25, 240, 270, 20)
        $htmsaveSource = GUICtrlCreateButton("Save as...", 300, 240, 95, 20, $BS_FLAT)
        GUIDelete($recup_info)
        GUISetState(@SW_SHOW, $gui)

        While 1
            $listener = GUIGetMsg()
            ;VARIABLES
            $name = GUICtrlRead($nom)
            $surname = GUICtrlRead($prenom)
            $surname = StringUpper(StringMid($surname, 1, 1)) & StringMid($surname, 2, StringLen($surname) - 1)
            $prenom_2 = GUICtrlSetData($prenom, $surname, "")
            $title = GUICtrlRead($titre)
            $phone = GUICtrlRead($telephone)
            $num_fax = GUICtrlRead($fax)
            $gsm = GUICtrlRead($mobile)
            $email = GUICtrlRead($mail)
            $email2 = GUICtrlRead($mailsuff)
            $lbl = GUICtrlRead($htmLblSource)
            $desfilename = GUICtrlRead($htmLblSource)
            $temp_sign = @TempDir & "\_Signature " & $surname & " " & $name & ".htm"
            $temp_help = @TempDir & "\helpgui\Signature_Introduction.html"
            Select
                ;Fermeture
                Case $listener = $GUI_EVENT_PRIMARYDOWN
                    accent()

                Case $listener = $GUI_EVENT_CLOSE Or $listener = $exititem Or $listener = $ctrlbutton4
                    If FileExists(@TempDir & "\_Signature *.*") Then
                        FileDelete(@TempDir & "\_Signature *.*")
                    EndIf
                    DirRemove(@TempDir & "\helpgui", 1)
                    ExitLoop
                    ;Reset
                Case $listener = $resetitem Or $listener = $ctrlbutton3
                    GUICtrlSetData($nom, $blank)
                    GUICtrlSetData($prenom, $blank)
                    GUICtrlSetData($titre, $blank)
                    GUICtrlSetData($telephone, $blank)
                    GUICtrlSetData($fax, $blank)
                    GUICtrlSetData($mobile, $blank)
                    GUICtrlSetData($mail, $blank)
                    GUICtrlSetData($mailsuff, $blank)
                    GUICtrlSetData($mailsuff, "@toto.com|@tata.com|@titi.com|@tutu.com")
                    GUICtrlSetData($htmLblSource, "Click on ""Save as...""")
                    ;Ouvrir
                Case $listener = $openitem Or $listener = $ctrlbutton0
                    $file = FileOpenDialog("Select your signature file", @MyDocumentsDir, "Documents HTM (*.htm)", 0)
                    Local $intFile = FileOpen($file, 0)
                    ;Lecture NOM
                    $nomread = FileReadLine($intFile, 3)
                    $nomread = StringReplace(StringReplace($nomread, "<!--NOM:", ""), "-->", "")
                    GUICtrlSetData($nom, $nomread)
                    ;Lecture PRENOM
                    $prenomread = FileReadLine($intFile, 4)
                    $prenomread = StringReplace(StringReplace($prenomread, "<!--PRENOM:", ""), "-->", "")
                    GUICtrlSetData($prenom, $prenomread)
                    ;Lecture TITRE
                    $titreread = FileReadLine($intFile, 5)
                    $titreread = StringReplace(StringReplace($titreread, "<!--TITRE:", ""), "-->", "")
                    GUICtrlSetData($titre, $titreread)
                    ;Lecture TELEPHONE
                    $telephoneread = FileReadLine($intFile, 6)
                    $telephoneread = StringReplace(StringReplace($telephoneread, "<!--TELEPHONE:", ""), "-->", "")
                    GUICtrlSetData($telephone, $telephoneread)
                    ;Lecture FAX
                    $faxread = FileReadLine($intFile, 7)
                    $faxread = StringReplace(StringReplace($faxread, "<!--FAX:", ""), "-->", "")
                    GUICtrlSetData($fax, $faxread)
                    ;Lecture MOBILE
                    $mobileread = FileReadLine($intFile, 8)
                    $mobileread = StringReplace(StringReplace($mobileread, "<!--MOBILE:", ""), "-->", "")
                    GUICtrlSetData($mobile, $mobileread)
                    ;Lecture MAIL
                    $mailread = FileReadLine($intFile, 9)
                    $mailread = StringReplace(StringReplace($mailread, "<!--MAIL:", ""), "-->", "")
                    GUICtrlSetData($mail, $mailread)
                    $mailsuffread = FileReadLine($intFile, 10)
                    $mailsuffread = StringReplace(StringReplace($mailsuffread, "<!--MAILSUFF:", ""), "-->", "")
                    GUICtrlSetData($mailsuff, $mailsuffread)
                    ;Emplacement FICHIER
                    GUICtrlSetData($htmLblSource, $file)
                    FileClose($intFile)
                    ;Aide
                Case $listener = $helpitem
                    ShellExecute($temp_help, 0)
                    ;Selection du nom de fichier et dossier de destination
                Case $listener = $htmsaveSource
                    GUICtrlSetData($htmLblSource, FileSaveDialog("Selectionnez la destination du fichier htm", @MyDocumentsDir, "Documents HTM (*.htm)"))
                    $filedir = GUICtrlSetData($htmLblSource, StringReplace(GUICtrlRead($htmLblSource) & ".htm", "vbs", "htm"))
                    $dest = GUICtrlRead($htmLblSource)
                    result($dest)
                    If $var = ".htm" Then
                        GUICtrlSetData($htmLblSource, "Click on ""Save as...""")
                    Else
                        GUICtrlSetData($htmLblSource, $var)
                        MsgBox(64, "Information", "To create your signature in your selected directory, you must click on ""Create""", 10)
                    EndIf
                    $desfilename = GUICtrlRead($htmLblSource)

                    ;###################################################################
                    ;APERCU
                    ;###################################################################
                Case $listener = $ctrlbutton1 Or $listener = $viewitem
                    Select
                        Case $name = ""
                            MsgBox(16, "Error", "No surname was registered." & @LF & "Please, register a surname then click on ""Preview"".", 5)
                        Case $surname = ""
                            MsgBox(16, "Error", "No firstname was registered." & @LF & "Please, register a firstname then click on ""Preview"".", 5)
                        Case $email2 = "" Or $email = ""
                            MsgBox(16, "Error", "Incomplete E-Mail." & @LF & "Please register your complete e-mail then click on ""Preview"".", 5)
                        Case Else
                            _FileCreate($temp_sign)
                            Local $intFile
                            $intFile = FileOpen($temp_sign, 2)
                            FileWriteLine($intFile, "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">")
                            FileWriteLine($intFile, "<HTML><HEAD><TITLE>Signature de " & $surname & " " & $name & "</TITLE>")
                            FileWriteLine($intFile, "<!--NOM:" & $name & "-->")
                            FileWriteLine($intFile, "<!--PRENOM:" & $surname & "-->")
                            FileWriteLine($intFile, "<!--TITRE:" & $title & "-->")
                            FileWriteLine($intFile, "<!--TELEPHONE:" & $phone & "-->")
                            FileWriteLine($intFile, "<!--FAX:" & $num_fax & "-->")
                            FileWriteLine($intFile, "<!--MOBILE:" & $gsm & "-->")
                            FileWriteLine($intFile, "<!--MAIL:" & $email & "-->")
                            FileWriteLine($intFile, "<!--MAILSUFF:" & $email2 & "-->")
                            FileWriteLine($intFile, "<STYLE>")
                            FileWriteLine($intFile, ".aaa {FONT-SIZE: 2mm}")
                            FileWriteLine($intFile, ".a:link {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, ".a:visited {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, ".a:active {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, ".Style1 {font-family:Times New Roman;font-size: 10pt; font-weight:bold;}")
                            FileWriteLine($intFile, ".Style2 {font-family:Times New Roman;font-size: 9pt; font-style: italic;}")
                            FileWriteLine($intFile, ".Style3 {font-family:Times New Roman;font-size: 11pt;}")
                            FileWriteLine($intFile, ".Style4 {font-family:Times New Roman;font-size: 8pt;}")
                            FileWriteLine($intFile, ".Style5 {font-family:Times New Roman;font-size: 9px; color: #999999;}")
                            FileWriteLine($intFile, ".Style6 {font-family:Times New Roman;font-size: 10px}")
                            FileWriteLine($intFile, ".Style7 {font-family:Times New Roman;font-size: 8pt;font-style: italic;}")
                            FileWriteLine($intFile, ".Style8 {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, "</STYLE></HEAD><BODY>")
                            FileWriteLine($intFile, "<TABLE width=auto cellSpacing=0 cellPadding=0 border=0>")
                            FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style1>" & $surname & " " & $name & "</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style2>" & $title & "</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style6 align=left><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style3 colspan=2 align=left>Van Cleef & Arpels</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>31, rue toto 75001 Paris - France</TD></TR>")
                            If Not $phone = "" Then
                                FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Phone : " & $phone & "</TD></TR>")
                            EndIf
                            If Not $num_fax = "" Then
                                FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Fax : " & $num_fax & "</TD></TR>")
                            EndIf
                            If Not $gsm = "" Then
                                FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Gsm : " & $gsm & "</TD></TR>")
                            EndIf
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=mailto:" & $email & $email2 & " title=" & $email & $email2 & ">" & $email & $email2 & "</A></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=http://www.google.com/ TARGET=_blank title=http://www.google.com>http://www.google.com</A></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD class=Style5><br><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><td class=Style4>REJOIGNEZ NOUS SUR FACEBOOK: <A href=http://www.facebook.com title=http://www.facebook.com TARGET=_blank class=Style8>http://www.facebook.com</A></TD>")
                            FileWriteLine($intFile, "<TR><td class=Style4>SUIVEZ NOUS SUR TWITTER: <A href=http://twitter.com title=http://twitter.com TARGET=_blank class=Style8>http://twitter.com</A></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><td class=Style2>Help save paper - do you need to print this email?</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><td class=Style7>CONFIDENTIAL :This message contains confidential information and is intended solely and exclusively for the use of its addressee(s). Any unauthorized copy or disclosure of its contents to any other person is strictly prohibited. If you are not the intended recipient of this message, kindly notify the sender immediately and delete this message and any attachments without retaining a copy.</TD></TR>")
                            FileWriteLine($intFile, "</TD></TR></TABLE>")
                            FileWriteLine($intFile, "</BODY></HTML>")
                            FileClose($intFile)
                            ShellExecute($temp_sign, "","","open")
                    EndSelect
                    ;###################################################################
                    ;CREATION
                    ;###################################################################
                Case $listener = $ctrlbutton2 Or $listener = $createitem
                    Select
                        Case $name = ""
                            MsgBox(16, "Error", "No surname was registered." & @LF & "Please, register a surname then click on ""Create"".", 5)
                        Case $surname = ""
                            MsgBox(16, "Error", "No firstname was registered." & @LF & "Please, register a firstname then click on ""Create"".", 5)
                        Case $email2 = "" Or $email = ""
                            MsgBox(16, "Error", "Incomplete E-Mail." & @LF & "Please register your complete e-mail then click on ""Create"".", 5)
                        Case $lbl = "Click on ""Save as..."""
                            MsgBox(16, "Error", "No file destination was selected" & @LF & "Please, choose a destination then click ""Create"".", 5)
                        Case Else
                            $m1 = "Creation in progress..."
                            FileDelete($desfilename)
                            _FileCreate($desfilename)
                            Local $intFile
                            $intFile = FileOpen($desfilename, 2)
                            FileWriteLine($intFile, "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">")
                            FileWriteLine($intFile, "<HTML><HEAD><TITLE>" & $surname & " " & $name & " Signature</TITLE>")
                            FileWriteLine($intFile, "<!--NOM:" & $name & "-->")
                            FileWriteLine($intFile, "<!--PRENOM:" & $surname & "-->")
                            FileWriteLine($intFile, "<!--TITRE:" & $title & "-->")
                            FileWriteLine($intFile, "<!--TELEPHONE:" & $phone & "-->")
                            FileWriteLine($intFile, "<!--FAX:" & $num_fax & "-->")
                            FileWriteLine($intFile, "<!--MOBILE:" & $gsm & "-->")
                            FileWriteLine($intFile, "<!--MAIL:" & $email & "-->")
                            FileWriteLine($intFile, "<!--MAILSUFF:" & $email2 & "-->")
                            FileWriteLine($intFile, "<STYLE>")
                            FileWriteLine($intFile, ".aaa {FONT-SIZE: 2mm}")
                            FileWriteLine($intFile, ".a:link {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, ".a:visited {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, ".a:active {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, ".Style1 {font-family:Times New Roman;font-size: 10pt; font-weight:bold;}")
                            FileWriteLine($intFile, ".Style2 {font-family:Times New Roman;font-size: 9pt; font-style: italic;}")
                            FileWriteLine($intFile, ".Style3 {font-family:Times New Roman;font-size: 11pt;}")
                            FileWriteLine($intFile, ".Style4 {font-family:Times New Roman;font-size: 8pt;}")
                            FileWriteLine($intFile, ".Style5 {font-family:Times New Roman;font-size: 9px; color: #999999;}")
                            FileWriteLine($intFile, ".Style6 {font-family:Times New Roman;font-size: 10px}")
                            FileWriteLine($intFile, ".Style7 {font-family:Times New Roman;font-size: 8pt;font-style: italic;}")
                            FileWriteLine($intFile, ".Style8 {font-family:Times New Roman;font-size: 8pt; color: #0000FF;}")
                            FileWriteLine($intFile, "</STYLE></HEAD><BODY>")
                            FileWriteLine($intFile, "<TABLE width=auto cellSpacing=0 cellPadding=0 border=0>")
                            FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style1>" & $surname & " " & $name & "</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto colspan=2 align=left class=Style2>" & $title & "</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style6 align=left><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style3 colspan=2 align=left>Van Cleef & Arpels</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>31, rue toto 75001 Paris - France</TD></TR>")
                            If Not $phone = "" Then
                                FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Phone : " & $phone & "</TD></TR>")
                            EndIf
                            If Not $num_fax = "" Then
                                FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Fax : " & $num_fax & "</TD></TR>")
                            EndIf
                            If Not $gsm = "" Then
                                FileWriteLine($intFile, "<TR><TD height=auto class=Style4 align=left>Gsm : " & $gsm & "</TD></TR>")
                            EndIf
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=mailto:" & $email & $email2 & " title=" & $email & $email2 & ">" & $email & $email2 & "</A></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD height=auto class=Style8 align=left><A href=http://www.google.com/ TARGET=_blank title=http://www.google.com>http://www.google.com</A></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD class=Style5><br><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><td class=Style4>REJOIGNEZ NOUS SUR FACEBOOK: <A href=http://www.facebook.com title=http://www.facebook.com TARGET=_blank class=Style8>http://www.facebook.com</A></TD>")
                            FileWriteLine($intFile, "<TR><td class=Style4>SUIVEZ NOUS SUR TWITTER: <A href=http://twitter.com title=http://twitter.com TARGET=_blank class=Style8>http://twitter.com</A></TD></TR>")
                            FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><td class=Style2>Help save paper - do you need to print this email?</TD></TR>")
                            FileWriteLine($intFile, "<TR><TD class=Style5><br></TD></TR>")
                            FileWriteLine($intFile, "<TR><td class=Style7>CONFIDENTIAL :This message contains confidential information and is intended solely and exclusively for the use of its addressee(s). Any unauthorized copy or disclosure of its contents to any other person is strictly prohibited. If you are not the intended recipient of this message, kindly notify the sender immediately and delete this message and any attachments without retaining a copy.</TD></TR>")
                            FileWriteLine($intFile, "</TD></TR></TABLE>")
                            FileWriteLine($intFile, "</BODY></HTML>")
                            FileClose($intFile)
                            ;Message de création
                            MsgBox(64, " " & StringTrimRight(@ScriptName, 4) & " " & $version & "", "File created and saved in " & $desfilename & "")
                    EndSelect
            EndSelect
        WEnd
EndSelect


Func accent()
    For $i = 0 To 6
        ;Libellé interne
        $surname = StringRegExpReplace($surname, $aConvert[$i][0], $aConvert[$i][1])
        $name = StringRegExpReplace($name, $aConvert[$i][0], $aConvert[$i][1])
        $email = GUICtrlSetData($mail, StringReplace(StringLower($surname) & "." & StringLower($name), " ", "-"))
    Next
EndFunc   ;==>accent

Func result($dest)
    $result = StringRight($dest, 8)
    Select
        Case $result = ".htm.htm"
            $var = StringTrimRight($dest, 4)
        Case Else
            $var = $dest
    EndSelect
EndFunc   ;==>result

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.