1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
| Dim st,i,tb
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objSourceFile = objFSO.OpenTextFile("WLMContacts.csv", 1)
Do Until objSourceFile.AtEndOfStream
vrRecupContacts = vrRecupContacts & vbCrLf
tb = split(objSourceFile.ReadLine,";")
vrRecupContacts = vrRecupContacts & tb(78) & ";" & tb(46) & ";" & tb(79) & ";"
vrRecupContactsVcard = vrRecupContactsVcard & vbCrLf & "BEGIN:VCARD" & vbCrLf & "FN:" & tb(78) & vbCrLf & "EMAIL;TYPE=INTERNET:" & tb(46) & vbCrLf & "END:VCARD"
vrRecupContactsCsvOutlook = vrRecupContactsCsvOutlook & vbCrLf & ";;;" & tb(78) & ";" & tb(46) & ";;;;;;;;;;;;;;;;;"
vrRecupContactsCsvGmail = vrRecupContactsCsvGmail & vbCrLf & tb(78) & "," & tb(46) & ",,Other,," & tb(79) & ",,,,,,,,"
Loop
objSourceFile.Close
vrRecupContacts = replace(vrRecupContacts,"""","")
vrRecupContacts = replace(vrRecupContacts,";"," ")
vrRecupContactsVcard = replace(vrRecupContactsVcard,"""","")
vrRecupContactsCsvOutlook = replace(vrRecupContactsCsvOutlook,"""","")
vrRecupContactsCsvGmail = replace(vrRecupContactsCsvGmail,"""","")
'Wscript.echo vrRecupContacts
Const ForReading = 1, ForWriting = 2
Set FichierTXT = WScript.CreateObject("WScript.Shell")
Dim fso, f
' On créer le fichier .txt à imprimer avec la liste de contact:
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("Contacts convertis\Mes contacts.txt", ForWriting,true)
f.writeline(vrRecupContacts)
f.close
' On créer la liste de contact Vcard:
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("Contacts convertis\Mes contacts vcard.vcf", ForWriting,true)
f.writeline(vrRecupContactsVcard)
f.close
' On créer la liste de contact csv pour outlook:
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("Contacts convertis\Mes contacts outlook.csv", ForWriting,true)
f.writeline("Prénom;Nom ;Deuxième prénom;Nom;Surnom;Adresse de messagerie;Rue (domicile);Ville (domicile);Code postal (domicile);Département (domicile);Pays/région (domicile);Téléphone personnel;Rue (bureau);Ville (bureau);Code postal (bureau);Département (bureau);Pays/région (bureau);Téléphone professionnel;Société;Fonction ;Service;Emplacement du bureau;Remarques")
f.writeline(vrRecupContactsCsvOutlook)
f.close
' On créer la liste de contact csv pour Gmail:
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("Contacts convertis\Mes contacts Gmail.csv", ForWriting,true)
f.writeline("Nom,E-mail,Remarques,Section 1 - Description,Section 1 - E-mail,Section 1 - IM,Section 1 - Téléphone,Section 1 - Portable,Section 1 - Téléavertisseur,Section 1 - Télécopie,Section 1 - Société,Section 1 - Titre,Section 1 - Autres,Section 1 - Adresse")
f.writeline(vrRecupContactsCsvGmail) |