Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2446 connectés 

  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  utilisation du shell en vba pour outlook

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

utilisation du shell en vba pour outlook

n°1004837
vato69
Posté le 08-03-2005 à 14:37:25  profilanswer
 

voici mon code quelqu'un pourrait t-il me dire ce qu'il va pas?

Code :
  1. Sub IMPORTERcalendrier()
  2.     Dim outlook_application As New Outlook.Application
  3.     Dim outlook_mapi As NameSpace
  4.     Dim outlook_folder As MAPIFolder
  5.     Dim objets_calendrier As Outlook.Items
  6.     Dim occurence_calendrier As Outlook.AppointmentItem
  7.     Dim propriete_calendrier As Outlook.ItemProperty
  8.     Dim WSHShell
  9.    
  10.     Dim v_titre, v_descriptif, v_datedeb, v_datefin As String
  11.    
  12.     Set outlook_mapi = outlook_application.GetNamespace("MAPI" )
  13.     Set outlook_folder = outlook_mapi.GetDefaultFolder(olFolderCalendar)
  14.     Set objets_calendrier = outlook_folder.Items
  15.     Set occurence_calendrier = objets_calendrier.Item(1)
  16.     Set WSHShell = CreateObject("wscript.Shell" )
  17.    
  18.    
  19.  
  20.     Open "C:\calendrier.txt" For Input As #1
  21.     Input #1, v_titre, v_descriptif, v_datedeb, v_datefin
  22.    
  23.     With occurence_calendrier
  24.         .Subject = v_titre
  25.         .Body = v_descriptif
  26.         .Start = v_datedeb
  27.         .End = v_datefin
  28.         .Save
  29.     End With
  30.     WSHShell.Run Trim(occurence_calendrier.Subject), 1, False
  31.     WSHShell.Run Trim(occurence_calendrier.Body), 1, False
  32.     WSHShell.Run Trim(occurence_calendrier.Start), 1, False
  33.     WSHShell.Run Trim(occurence_calendrier.End), 1, False
  34.     WSHShell.Run Trim(occurence_calendrier.Save), 1, False
  35.    
  36.     Set occurence_calendrier = Nothing
  37.     Set outlook_folder = Nothing
  38.     Set outlook_mapi = Nothing
  39.     Set outlook_application = Nothing
  40.     Set objets_calendrier = Nothing
  41.     Set WSHShell = Nothing
  42. End Sub

mood
Publicité
Posté le 08-03-2005 à 14:37:25  profilanswer
 

n°1004870
vato69
Posté le 08-03-2005 à 14:47:34  profilanswer
 

avec ceci ce que je désire faire c'est d'executer ma macro en ligne de commande, j'utilise outlook 2003

n°1007672
knakes
Posté le 10-03-2005 à 08:33:00  profilanswer
 

Tu as exécuté ton programme ? il te retourne une erreur ?
 
Sinon tu as mis : Open #1 ...., il te manque Close #1 !!!


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  VB/VBA/VBS

  utilisation du shell en vba pour outlook

 

Sujets relatifs
utilisation du crypt[Résolu][VBA Word] insertion de rendez-vous dans outlook
[shell] remplacement d'espacesPort série, Linux & Utilisation non-standard
Comment envoyer des mails sous vb via outlook 2003[ Shell] Merge fichier
[ Shell ] Obtenir la date du lendemain ?SOS utilisation de AXIS pour dvp un webservice
J2ME -> Utilisation de KXmlRPC: blocage au 256ème caractère de réponseCalcul la durée d'un RV dans Outlook
Plus de sujets relatifs à : utilisation du shell en vba pour outlook


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR