Précédent   Forum des professionnels en informatique > Logiciels > Microsoft Office > Général VBA > Contribuez
Contribuez Proposez vos articles, cours, tutoriels, faq, codes sources, astuces pour VBA
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 29/04/2003, 15h06   #1
Invité de passage
 
Inscription : avril 2003
Messages : 8
Détails du profil
Informations forums :
Inscription : avril 2003
Messages : 8
Points : 1
Points : 1
Envoyer un message via ICQ à stan28 Envoyer un message via MSN à stan28
Par défaut [][VB/Powerpoint] : nombre de diapo entre autre

Salut!!
Voila je voudrais savoir s'il existe des fonctions en vb permettant de gerer les diapositives d'un document powerpoint, tel le nombre de diapo, sauvegarder tel ou tel diapo en jpeg etc
stan28 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/04/2003, 15h22   #2
Expert Confirmé Sénior

 
Avatar de bidou
 
Inscription : mai 2002
Messages : 3 052
Détails du profil
Informations personnelles :
Âge : 45
Localisation : France, Rhône (Rhône Alpes)

Informations forums :
Inscription : mai 2002
Messages : 3 052
Points : 4 101
Points : 4 101
oui
nb de diapo
Code :
Presentation("MaPres").Slides.Count
sauver une diapo en jpeg
Code :
Presentation("MaPres").Slides(1).Export "c:\madiapo", "JPG"
etc...
__________________
Tutoriels VB
Cours
bidou est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/04/2003, 15h24   #3
Invité de passage
 
Inscription : avril 2003
Messages : 8
Détails du profil
Informations forums :
Inscription : avril 2003
Messages : 8
Points : 1
Points : 1
Envoyer un message via ICQ à stan28 Envoyer un message via MSN à stan28
oki et merci
stan28 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/04/2003, 16h00   #4
Invité de passage
 
Inscription : avril 2003
Messages : 8
Détails du profil
Informations forums :
Inscription : avril 2003
Messages : 8
Points : 1
Points : 1
Envoyer un message via ICQ à stan28 Envoyer un message via MSN à stan28
ca marche pas : est tu sur de la syntaxe, ou pe etr ke ca dépend de la version de powerpoint, moi g le 2000
stan28 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/04/2003, 16h08   #5
Expert Confirmé Sénior

 
Avatar de bidou
 
Inscription : mai 2002
Messages : 3 052
Détails du profil
Informations personnelles :
Âge : 45
Localisation : France, Rhône (Rhône Alpes)

Informations forums :
Inscription : mai 2002
Messages : 3 052
Points : 4 101
Points : 4 101
je suis en 97

ca marche si la présentation est ouverte
__________________
Tutoriels VB
Cours
bidou est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/04/2003, 16h12   #6
Invité de passage
 
Inscription : avril 2003
Messages : 8
Détails du profil
Informations forums :
Inscription : avril 2003
Messages : 8
Points : 1
Points : 1
Envoyer un message via ICQ à stan28 Envoyer un message via MSN à stan28
je l'ouvre : voici mon code

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
Set pPoint = New PowerPoint.Application
            Set sPoint = pPoint.Presentations.Open(path_fonfPP)
            nbDiapo = Presentation(pPoint).Slides.Count
            If (nbDiapo > 1) Then
                erreur = MsgBox("Votre fichier powerpoint ne doit contenir que la diapo correspondant au fond souhaité", vbOKOnly, "Erreur!!!")
                Exit Sub
            Else
                If (nbDiapo < 1) Then
                    erreur = MsgBox("Votre fichier powerpoint doit contenir une diapo correspondant au fond souhaité", vbOKOnly, "Erreur!!!")
                    Exit Sub
                End If
            End If
            Presentation(path_fondPP).Slides(1).Export path_site +  "fond.jpg"
je suis pas sur du + pour le export, mais de toute facon il m'indik pas d'erreur la, il di k'il conné pas le mot Export
stan28 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/04/2003, 16h22   #7
Expert Confirmé Sénior

 
Avatar de bidou
 
Inscription : mai 2002
Messages : 3 052
Détails du profil
Informations personnelles :
Âge : 45
Localisation : France, Rhône (Rhône Alpes)

Informations forums :
Inscription : mai 2002
Messages : 3 052
Points : 4 101
Points : 4 101
ca devrait marcher mieux comme cela
Fait attention qu'il ne manque pas un antislash dans path_site & "fond"
Code :
1
2
3
4
5
6
7
8
9
10
11
Set pPoint = New PowerPoint.Application 
Set sPoint = pPoint.Presentations.Open(path_fonfPP) 
nbDiapo = sPoint.Slides.Count 
If (nbDiapo > 1) Then 
    MsgBox "Votre fichier powerpoint ne doit contenir que la diapo correspondant au fond souhaité", vbOKOnly, "Erreur!!!"
    Exit Sub 
ElseIf (nbDiapo < 1) Then 
     MsgBox "Votre fichier powerpoint doit contenir une diapo correspondant au fond souhaité", vbOKOnly, "Erreur!!!"
     Exit Sub 
End If 
sPoint.Slides(1).Export path_site &  "fond", "JPG"
__________________
Tutoriels VB
Cours
bidou est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/04/2003, 16h49   #8
Invité de passage
 
Inscription : avril 2003
Messages : 8
Détails du profil
Informations forums :
Inscription : avril 2003
Messages : 8
Points : 1
Points : 1
Envoyer un message via ICQ à stan28 Envoyer un message via MSN à stan28
c bon ca marche, a part ke c relou car powerpoint souvre forcement, pas moyen de mettre visible = false sinon ca merde a l'execution, mais a part ce
stan28 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/04/2003, 16h58   #9
Invité de passage
 
Inscription : avril 2003
Messages : 8
Détails du profil
Informations forums :
Inscription : avril 2003
Messages : 8
Points : 1
Points : 1
Envoyer un message via ICQ à stan28 Envoyer un message via MSN à stan28
Non en fait tjrs un petit pb : pa moyen de fermer powerpoint même avec un close, donc si kk'un a un idée
stan28 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/04/2003, 17h24   #10
Expert Confirmé Sénior

 
Avatar de bidou
 
Inscription : mai 2002
Messages : 3 052
Détails du profil
Informations personnelles :
Âge : 45
Localisation : France, Rhône (Rhône Alpes)

Informations forums :
Inscription : mai 2002
Messages : 3 052
Points : 4 101
Points : 4 101
pPoint.Quit
__________________
Tutoriels VB
Cours
bidou est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/04/2003, 17h39   #11
Invité de passage
 
Inscription : avril 2003
Messages : 8
Détails du profil
Informations forums :
Inscription : avril 2003
Messages : 8
Points : 1
Points : 1
Envoyer un message via ICQ à stan28 Envoyer un message via MSN à stan28
je fé pPoint.quit, mais en fait c bizarre : ca ferme bien la presentation que g ouverte, mais pas powerPoint lui même qui reste ouvert sans document
stan28 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/04/2003, 18h43   #12
Invité de passage
 
Inscription : avril 2003
Messages : 8
Détails du profil
Informations forums :
Inscription : avril 2003
Messages : 8
Points : 1
Points : 1
Envoyer un message via ICQ à stan28 Envoyer un message via MSN à stan28
bon et bien en fait c resolu grace a un alt f4, suivit d'un bouche pour faire une petite pause de 0.25sec, car sinon ca ferme aussi l'application :/

je donne le code, ca pourra tjrs servir a d'autres

Code :
1
2
3
4
5
6
7
8
SendKeys "%{F4}"
        pause = 0.25
        start = Timer
        Do While Timer < start + pause
            DoEvents
        Loop
        SendKeys "{NumLock}"
        GenerationSite.Hide
stan28 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 00h45.


 
 
 
 
Partenaires

Hébergement Web