Créer un fichier ical ou ics depuis le code vba excel

Larounel Messages postés 7 Date d'inscription lundi 20 décembre 2004 Statut Membre Dernière intervention 15 décembre 2018 - 1 avril 2009 à 14:37
Larounel Messages postés 7 Date d'inscription lundi 20 décembre 2004 Statut Membre Dernière intervention 15 décembre 2018 - 1 avril 2009 à 21:09
Bonjour!
Il y a très longtemps que je n'ai pas posté sur ce forum mais je n'ai jamais cessé de venir puiser beaucoup d'informations, afin de mener à bout mes développements.

Sous Microsoft Excel 2007 et VB6.3
J'aimerai créer depuis un code VB un fichier .ical ou .ics.
L'envoyer par mail à une adresse seulement.
le pc du mail pourra ouvrir l'évènement et l'enregistrer dans son calendrier.

Est-ce possible?
Comment s'y prendre?

Merci pour vos prochaines réponses,
Cordialement,
Sébastien.

1 réponse

Larounel Messages postés 7 Date d'inscription lundi 20 décembre 2004 Statut Membre Dernière intervention 15 décembre 2018
1 avril 2009 à 21:09
Bonsoir,

Pour ceux que ça intéresse, j'ai réussi à créer le fichier .ics depuis un module vba.

<li>Sub rvgen()
</li><li>nomdufichier = Sheets("parametres").Range("b1").Text
</li><li>'Dans mon cas je récupère l'info dans une cellule</li><li>
</li><li>chemin = "c:\DDPAX"
</li><li>echs = Sheets("groupes").Range("al1000").End(xlUp).Offset(0, 0).Value
</li><li>echs = Format(echs, "yyyymmdd")
</li><li>
</li><li>Open chemin & nomdufichier & ".ics" For Output As #1
</li><li>
</li><li>Print #1, "BEGIN:VCALENDAR"
</li><li>Print #1, "BEGIN:VEVENT"
</li><li>Print #1, "ORGANIZER;CN=DDPAX:MAILTO:contact@email.com"
</li><li>Print #1, "DTSTART:" & echs
</li><li>Print #1, "DTEND:" & echs
</li><li>Print #1, "SUMMARY:Relance " & Sheets("groupes").Range("d1000").End(xlUp).Offset(0, 0).Text & _
</li><li>" | " & Sheets("groupes").Range("am1000").End(xlUp).Offset(0, 0).Text & _
</li><li>" | " & Sheets("groupes").Range("an1000").End(xlUp).Offset(0, 0).Text & " €ttc" & _
</li><li>" | " & Sheets("groupes").Range("al1000").End(xlUp).Offset(0, 0).Text
</li><li>Print #1, "CATEGORIES:RELANCE FACTURE"
</li><li>Print #1, "LOCATION:C:\DDPAX\FACTURES GROUPES.xltm"
</li><li>Print #1, "DESCRIPTION:Ce rappel vous demande de relancer: .\nLe client: " & _
</li><li>Sheets("groupes").Range("d1000").End(xlUp).Offset(0, 0).Text & _
</li><li>".\nLa Facture: " & _
</li><li>Sheets("groupes").Range("am1000").End(xlUp).Offset(0, 0).Text & _
</li><li>".\nLe Montant: " & _
</li><li>Sheets("groupes").Range("an1000").End(xlUp).Offset(0, 0).Text & " €ttc" & _
</li><li>".\nL'échéance: " & _
</li><li>Sheets("groupes").Range("al1000").End(xlUp).Offset(0, 0).Text & _
</li><li>".\nfile:///C:/DDPAX/FACTURES GROUPES.xlsm"
</li><li>Print #1, "BEGIN:VALARM"
</li><li>Print #1, "ACTION:DISPLAY"
</li><li>Print #1, "TRIGGER:-PT15M"
</li><li>Print #1, "REPEAT:4"
</li><li>Print #1, "DURATION:PT8H"
</li><li>Print #1, "END:VALARM"
</li><li>Print #1, "END:VEVENT"
</li><li>Print #1, "END:VCALENDAR"
</li><li>Close #1
</li><li>EndSub</li>maintenant je cherche à ouvrir outlook 2007 et lancer ce fichier.

si qq1 sais... je prends
0
Rejoignez-nous