Citation :
'HTML signature
On Error Resume Next
Set objSysInfo = CreateObject("ADSystemInfo" )
strUser = objSysInfo.UserName
Set objUser = GetObject("LDAP://" & strUser)
strNomComplet = objUser.FullName
strPrenom = objuser.givenName
strNom = objuser.sn
strFonction = objUser.Title
strDescription = objUser.Description
strService = objUser.Department
strBureau = objUser.physicalDeliveryOfficeName
strSociete = objUser.Company
strAddress = objuser.streetAddress
strCity = objuser.l
strState = objuser.st
strZip = objuser.postalCode
strTelephone = objUser.telephoneNumber
strTelephoneMobile = objUser.mobile
strMail = objuser.mail
strWeb = objuser.wWWHomePage
strFax = objUser.faxNumber
strDivision = objUser.Division
strActu = "www.proarchives.fr/actualites"
logoBanniere = "banniere.gif"
flgAdresse = False
Select Case strBureau
Case "Groupe-PRO.ARCHIVES":
logoSociete = "Groupe-PRO.ARCHIVES_100.gif"
logoSociete1 = "PRO.ARCHIVES_85.gif"
logoSociete2 = "AGO_85.gif"
logoSociete3 = "PRO.NUMERIQUE_85.gif"
logoSociete4 = "PRO.DOCS_85.gif"
strWeb1 = "www.proarchives.fr"
strWeb2 = "www.ago-sa.fr"
strWeb3 = "www.pronumerique.com"
strWeb4 = "www.prodocs.fr"
Case "PRO.ARCHIVES":
logoSociete = "PRO.ARCHIVES_100.gif"
logoSociete1 = "Groupe-PRO.ARCHIVES_85.gif"
logoSociete2 = "PRO.NUMERIQUE_85.gif"
logoSociete3 = "PRO.DOCS_85.gif"
logoSociete4 = "AGO_85.gif"
strWeb1 = "www.groupe-proarchives.fr"
strWeb2 = "www.pronumerique.com"
strWeb3 = "www.prodocs.fr"
strWeb4 = "www.ago-sa.fr"
Case "PRO.NUMERIQUE":
logoSociete = "PRO.NUMERIQUE_100.gif"
logoSociete1 = "Groupe-PRO.ARCHIVES_85.gif"
logoSociete2 = "PRO.ARCHIVES_85.gif"
logoSociete3 = "AGO_85.gif"
logoSociete4 = "PRO.DOCS_85.gif"
strWeb1 = "www.groupe-proarchives.fr"
strWeb2 = "www.proarchivs.fr"
strWeb3 = "www.ago-sa.fr"
strWeb4 = "www.prodocs.fr"
'Case PRO.ASC:
' logoSociete = "proasc.gif"
Case Else
strBureau = "Groupe-PRO.ARCHIVES"
logoSociete = "Groupe-PRO.ARCHIVES_100.gif"
logoSociete1 = "PRO.ARCHIVES_85.gif"
logoSociete2 = "AGO_85.gif"
logoSociete3 = "PRO.NUMERIQUE_85.gif"
logoSociete4 = "PRO.DOCS_85.gif"
strWeb1 = "www.proarchives.fr"
strWeb2 = "www.ago-sa.fr"
strWeb3 = "www.pronumerique.com"
strWeb4 = "www.prodocs.fr"
End Select
strPhone2=strTelephone
strFax2=strFax
strMobilePhone2=strTelephoneMobile
'IF (strNomComplet = "Dupont DURAND" OR strNomComplet = "Exemple exemple" ) THEN logoSociete = "pronumerique.gif" ELSE logoSociete = "proarchives.gif"
'IF (strTelephone=" " OR strTelephone = Null OR IsEmpty(strTelephone)) THEN strPhone2 = InputBox("Veuillez entrer votre numero de téléphone cliquez sur ""annuler"" pour laisser le champs vide" )
'IF (strTelephoneMobile=" " OR strTelephoneMobile = Null OR IsEmpty(strTelephoneMobile)) THEN strMobilePhone2 = InputBox("Veuillez entrer votre numero de téléphone portable cliquez sur ""annuler"" pour laisser le champs vide" )
'IF (strFax=" " OR strFax = Null OR IsEmpty(strFax)) THEN strFax2 = InputBox("Veuillez entrer votre numero de Fax cliquez sur ""annuler"" pour laisser le champs vide" )
Dim objFSO, objWsh, appDataPath, pathToCopyTo, plainTextFile, plainTextFilePath, richTextFile, richTextFilePath, htmlFile, htmlFilePath, scriptPath
Const OverwriteExisting = True, ForReading = 1, ForWriting = 2, ForAppending = 8, ModeAscii = 0, ModeUnicode = -1
Set objFSO = CreateObject("Scripting.FileSystemObject" )
Set objWsh = CreateObject("WScript.Shell" )
appDataPath = objWsh.ExpandEnvironmentStrings("%APPDATA%" )
pathToCopyTo = appDataPath & "\Microsoft\Signatures\"
'scriptPath = "\\le\repertoire\du\script"
scriptPath = objFSO.GetParentFolderName(wscript.ScriptFullName)
'msgbox scriptPath
source = "X:\Utilitaires\Signature_Outlook\Logos"
'IF () THEN source = Input
IF objFSO.FileExists(pathToCopyTo & "Logos\" & logoBanniere) THEN
objFSO.DeleteFile pathToCopyTo & "Logos\" & logoBanniere
END IF
objFSO.CopyFolder source, pathToCopyTo, OverwriteExisting
objFSO.CopyFile "X:\Utilitaires\Signature_Outlook\FORMULE_POLITESSE_Outlook.txt", "U:\FORMULE_POLITESSE_Outlook.txt", False
'objFSO.CopyFile "U:\FORMULE_POLITESSE_Outlook.txt", pathToCopyTo, OverwriteExisting
htmlFilePath = pathToCopyTo & "Defaut_" & strNom & ".htm"
Set htmlFile = objFSO.CreateTextFile(htmlFilePath, TRUE)
htmlFile.WriteLine("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>" )
htmlFile.WriteLine("<head>" )
htmlFile.WriteLine(" <meta http-equiv=Content-Type content='text/html; charset=iso-8859-1'>" ) 'iso-8859-1 windows-1252 UTF-8
htmlFile.WriteLine(" <meta content='MSHTML 6.00.6000.16640' name=GENERATOR>" )
htmlFile.WriteLine("</head>" )
htmlFile.WriteLine("<body>" )
Dim filesys, text, readfile, contents
set filesys = CreateObject("Scripting.FileSystemObject" ) 'set readfile = filesys.OpenTextFile("U:\Essai.txt", 1, False)
set readfile = filesys.OpenTextFile("U:\FORMULE_POLITESSE_Outlook.txt", 1, False)
htmlFile.WriteLine("<span style='font-family: Calibri, Verdana, Arial, Helvetica, sans-serif; font-size: 11pt'>" )
do while readfile.AtEndOfStream=false contents = readfile.ReadLine
htmlFile.WriteLine(contents)
htmlFile.WriteLine(" <br />" )
loop
htmlFile.WriteLine("</span>" )
readfile.close
htmlFile.WriteLine(" <br />" )
htmlFile.WriteLine(" <table border='0' cellpadding='0' cellspacing='0'>" )
htmlFile.WriteLine(" <tr>" )
htmlFile.WriteLine(" <td width='100' valign='middle'>" )
htmlFile.WriteLine(" <div align='left'><a href='http://" & strWeb & "' ><img src='" & pathToCopyTo & "Logos\" & logoSociete & "' alt='Solutions d’archivage dédiées aux Administrateurs de Biens - Visitez notre site Web' width='100' height='100' border='0' align='middle'/></a></div>" )
htmlFile.WriteLine(" </td>" )
htmlFile.WriteLine(" <td width='10'></td>" )
IF (strService="Commercial" ) THEN
htmlFile.WriteLine(" <td width='100' valign='middle'>" )
htmlFile.WriteLine(" <div align='left'><a href='http://" & strWeb & "' ><img src='" & pathToCopyTo & "Logos\PRO.NUMERIQUE_100.gif' alt='Solutions d’archivage dédiées aux Administrateurs de Biens - Visitez notre site Web' width='100' height='100' border='0' align='middle'/></a></div>" )
htmlFile.WriteLine(" </td>" )
htmlFile.WriteLine(" <td width='10'></td>" )
END IF
htmlFile.WriteLine(" <td>" )
htmlFile.WriteLine(" <table border='0' cellpadding='0' cellspacing='0'>" )
htmlFile.WriteLine(" <tr valign='top'>" )
htmlFile.WriteLine(" <td colspan='3'>" )
htmlFile.WriteLine(" <span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 10pt; color: black'>" & strPrenom & " " & strNom & "</span>" ) 'color: #FF8040;
htmlFile.WriteLine(" </td>" )
htmlFile.WriteLine(" </tr>" )
htmlFile.WriteLine(" <tr valign='top'>" )
htmlFile.WriteLine(" <td colspan='3' style='font-family: "Times New Roman", Times, serif; font-weight: bold; font-style: italic; font-size: 11pt; color: black'>" & strDescription & "</td>" ) 'color: maroon;
htmlFile.WriteLine(" </tr>" )
htmlFile.WriteLine(" <tr valign='bottom'>" )
htmlFile.WriteLine(" <td width='50' height='15'><span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 7pt; color: black'>Téléphone</span></td>" ) 'color: maroon;
htmlFile.WriteLine(" <td width='15'><span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 7pt; color: black'>:</span></td>" ) 'color: maroon;
htmlFile.WriteLine(" <td width='300'><span style='font-family: "Times New Roman", Times, serif; font-weight: bold; font-size: 8pt; color: black'> " & strPhone2 & "</span></td>" ) 'color: #FF8040;
htmlFile.WriteLine(" </tr>" )
htmlFile.WriteLine(" <tr valign='bottom'>" )
htmlFile.WriteLine(" <td><span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 7pt; color: black'>Télécopie</span></td>" ) 'color: maroon;
htmlFile.WriteLine(" <td><span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 7pt; color: black'>:</span></td>" ) 'color: maroon;
htmlFile.WriteLine(" <td><span style='font-family: "Times New Roman", Times, serif; font-weight: bold; font-size: 8pt; color: black'> " & strFax2 & "</span></td>" ) 'color: #FF8040;
htmlFile.WriteLine(" </tr>" )
IF NOT IsEmpty(strTelephoneMobile) THEN
htmlFile.WriteLine(" <tr valign='bottom'>" )
htmlFile.WriteLine(" <td><span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 7pt; color: black'>Mobile</span></td>" ) 'color: maroon;
htmlFile.WriteLine(" <td><span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 7pt; color: black'>:</span></td>" ) 'color: maroon;
htmlFile.WriteLine(" <td><span style='font-family: "Times New Roman", Times, serif; font-weight: bold; font-size: 8pt; color: black'> " & strTelephoneMobile & "</span></td>" ) 'color: #FF8040;
htmlFile.WriteLine(" </tr>" )
END IF
htmlFile.WriteLine(" <tr valign='bottom'>" )
htmlFile.WriteLine(" <td><span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 7pt; color: black'>Courriel</span></td>" ) 'color: maroon;
htmlFile.WriteLine(" <td><span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 7pt; color: black'>:</span></td>" ) 'color: maroon;
'htmlFile.WriteLine(" <td></td>" )
htmlFile.WriteLine(" <td><a href='mailto:" & strMail &"'><span style='font-family: "Times New Roman", Times, serif; font-size: 8pt; color: #0000CC; text-decoration: underline;'>" & strMail & "</span></a></td>" )
htmlFile.WriteLine(" </tr>" )
htmlFile.WriteLine(" <tr valign='middle'>" ) 'top
htmlFile.WriteLine(" <td width='60'><span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 9pt; color: black'>Site</span></td>" ) 'color: maroon; font-size: 7pt
htmlFile.WriteLine(" <td width='15'><span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9pt; color: black'>:</span></td>" ) 'color: maroon; font-size: 7pt
'htmlFile.WriteLine(" <td width='5'></td>" )
htmlFile.WriteLine(" <td>" )
htmlFile.WriteLine(" <a href='http://" & strWeb & "'>" )
htmlFile.WriteLine(" <span style='font-family: "Times New Roman", Times, serif; font-weight: bold; font-size: 10pt; color: red; text-decoration: underline;'>Visitez notre nouveau site</span>" ) ' font-size: 8pt
htmlFile.WriteLine(" <span style='font-family: "Times New Roman", Times, serif; font-weight: bold; font-size: 10pt; color: #0000CC; text-decoration: underline;'>" & strWeb & "</span>" ) ' font-size: 8pt
htmlFile.WriteLine(" </a>" )
htmlFile.WriteLine(" </td>" )
htmlFile.WriteLine(" <td>" )
htmlFile.WriteLine(" <div valign='top'><a href='http://" & strWeb & "' ><img src='" & pathToCopyTo & "Logos\New.gif' alt='Visitez notre nouveau site Web' border='0' align='left'/></a></div>" )
htmlFile.WriteLine(" </td>" )
htmlFile.WriteLine(" </tr>" )
htmlFile.WriteLine(" </table>" )
htmlFile.WriteLine(" </td>" )
' Nouvelle adresse ou bannière
IF flgAdresse OR objFSO.FileExists(pathToCopyTo & "Logos\" & logoBanniere) THEN
htmlFile.WriteLine(" <td width='5'></td>" )
REM ' Début bannière
IF objFSO.FileExists(pathToCopyTo & "Logos\" & logoBanniere) THEN
htmlFile.WriteLine(" <td width='320'>" )
htmlFile.WriteLine(" <table>" )
htmlFile.WriteLine(" <tr>" )
htmlFile.WriteLine(" <td width='100' valign='middle'>" )
htmlFile.WriteLine(" <div align='left'><a href='http://" & strActu & "' ><img src='" & pathToCopyTo & "Logos\" & logoBanniere & "' alt='Consultez nos actualités' border='0' align='middle'/></a></div>" ) 'width='300' height='70' htmlFile.WriteLine(" </td>" )
htmlFile.WriteLine(" </tr>" )
htmlFile.WriteLine(" </table>" )
htmlFile.WriteLine(" </td>" )
END IF
REM ' Fin bannière
IF FlgAdresse THEN
htmlFile.WriteLine(" <td width='420'>" )
htmlFile.WriteLine(" <table border=0 cellspacing=0 cellpadding=0 align=left bgcolor=yellow style='font-size:9.0pt;font-family:Verdana;color:red;font-weight:bold'>" )
htmlFile.WriteLine(" <tr>" )
htmlFile.WriteLine(" <td align='center' valign='middle' style='width:550pt;border:solid windowtext 1.0pt;padding:0cm 3.5pt 0cm 3.5pt;height:71.4pt'>" )
htmlFile.WriteLine(" ATTENTION ! <br /><font style='font-size:3.0pt'> </font><br />" )
htmlFile.WriteLine(" NOUVELLE ADRESSE A COMPTER DU 8 MARS 2010 :<br /><font style='font-size:3.0pt'> </font><br />" )
htmlFile.WriteLine(" " & strSociete & "<br />" )
htmlFile.WriteLine(" 151, Rue Gilles de ROBERVAL<br />" )
htmlFile.WriteLine(" 30900 NIMES" )
htmlFile.WriteLine(" </td>" )
htmlFile.WriteLine(" </tr>" )
htmlFile.WriteLine(" </table>" )
htmlFile.WriteLine(" </td>" )
END IF
REM ' Fin Adresse
END IF
' Fin Nouvelle adresse ou bannière
htmlFile.WriteLine(" </tr>" )
'htmlFile.WriteLine(" <tr valign='top'>" )
'htmlFile.WriteLine(" <td height='20' colspan='3' valign='middle'><span style='font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 8pt;'>Solutions d'archivage dédiées aux Administrateurs de Biens</span></td>" )
'htmlFile.WriteLine(" </tr>" )
htmlFile.WriteLine(" </table>" )
IF strBureau = "Groupe-PRO.ARCHIVES" THEN
htmlFile.WriteLine("<br />" )
htmlFile.WriteLine("<table border='0' cellpadding='0' cellspacing='0' >" )
htmlFile.WriteLine(" <tr>" )
htmlFile.WriteLine(" <td width='100'><div align='left'><a href='http://" & strWeb1 & "' ><img src='" & pathToCopyTo & "Logos\" & logoSociete1 & "' width='85' height='85' border='0' align='middle'/></a></div></td>" )
htmlFile.WriteLine(" <td width='100'><div align='left'><a href='http://" & strWeb2 & "' ><img src='" & pathToCopyTo & "Logos\" & logoSociete2 & "' width='85' height='85' border='0' align='middle'/></a></div></td>" )
htmlFile.WriteLine(" <td width='100'><div align='left'><a href='http://" & strWeb3 & "' ><img src='" & pathToCopyTo & "Logos\" & logoSociete3 & "' width='85' height='85' border='0' align='middle'/></a></div></td>" )
htmlFile.WriteLine(" <td width='100'><div align='left'><a href='http://" & strWeb4 & "' ><img src='" & pathToCopyTo & "Logos\" & logoSociete4 & "' width='85' height='85' border='0' align='middle'/></a></div></td>" )
htmlFile.WriteLine(" </tr>" )
htmlFile.WriteLine("</table>" )
END IF
htmlFile.WriteLine(" <img src='" & pathToCopyTo & "Logos\arbre_ecolo_trans.gif' width='25' height='25' border=0/> <span style='font-family: "Times New Roman", Times, serif; font-style: italic; color: green; font-size: 10pt; font-weight: bold;'>Afin de contribuer au respect de l'environnement, merci de n'imprimer ce courriel que si nécessaire.</span>" )
htmlFile.WriteLine(" <br />" )
htmlFile.WriteLine(" <div style='width:550px; border-top: 1px solid #666666; border-bottom: 1px solid #666666; padding:0px; font-size:9px; font-family:Verdana, Arial, Helvetica, sans-serif' align='justify' >" )
htmlFile.WriteLine(" Ce message et toutes les pièces jointes sont confidentiels et établis à l'attention exclusive de ses destinataires." )
htmlFile.WriteLine(" Toute utilisation de ce message non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse." )
htmlFile.WriteLine(" Si vous recevez ce message par erreur, merci de le détruire et d'en avertir immédiatement l'expéditeur." )
IF strBureau = "Groupe-PRO.ARCHIVES" THEN
htmlFile.WriteLine(strBureau & " et ses partenaires déclinent toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié." )
ELSE
htmlFile.WriteLine(" La Société " & strBureau & " et ses partenaires déclinent toute responsabilité au titre de ce message s'il a été altéré, déformé ou falsifié." )
END IF
'htmlFile.WriteLine(" <!--<br />" )
'htmlFile.WriteLine(" <br />" )
'htmlFile.WriteLine(" This message and all attachments are confidential and intended solely for the addressees." )
'htmlFile.WriteLine(" Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval." )
'htmlFile.WriteLine(" If you receive this message in error, please delete it and immediately notify the sender." )
'htmlFile.WriteLine(" Neither " & strBureau & " company nor any of its subsidiaries shall be liable for the message if altered, changed or falsified." )
'htmlFile.WriteLine(" -->" )
htmlFile.WriteLine(" </div>" )
htmlFile.WriteLine("</body>" )
htmlFile.WriteLine("</html>" )
htmlFile.Close
|