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
|
Voici comment ouvrir PowerPoint avec Ole
Je ne sais pas s'il faut inclure "#include <utilcls.h>" a voir?
Variant vMSPowerPoint,NameSpace;
try
{
vMSPowerPoint = Variant::GetActiveObject("PowerPoint.Application");
}
catch(...)
{
vMSPowerPoint = Variant::CreateObject("PowerPoint.Application");
}
vMSPowerPoint.OlePropertySet("Visible", true);
//
Voici comment fermer PowerPoint avec Ole
vMSPowerPoint.OleFunction("Quit");
vMSPowerPoint = Unassigned;
//
Voici comment ouvrir un fichier d'une presentation PowerPoint.
Variant vMSPowerPoint;
vMSPowerPoint.OlePropertyGet("Presentations").OleFunction("Open", "C:\\Documents and Settings\\blondelle\\Mes documents\\astro\\Presentation_master05.ppt", false);
//
Voici comment executer une presentation OlePowerPoint
vMSPowerPoint.OlePropertyGet("ActivePresentation").OlePropertyGet("SlideShowSettings").OlePropertySet("ShowType", 1);
vMSPowerPoint.OlePropertyGet("ActivePresentation").OlePropertyGet("SlideShowSettings").OlePropertySet("LoopUntilStopped", 0);
vMSPowerPoint.OlePropertyGet("ActivePresentation").OlePropertyGet("SlideShowSettings").OlePropertySet("ShowWithNarration", -1);
vMSPowerPoint.OlePropertyGet("ActivePresentation").OlePropertyGet("SlideShowSettings").OlePropertySet("ShowWithAnimation", -1);
vMSPowerPoint.OlePropertyGet("ActivePresentation").OlePropertyGet("SlideShowSettings").OlePropertySet("RangeType", 1);
vMSPowerPoint.OlePropertyGet("ActivePresentation").OlePropertyGet("SlideShowSettings").OlePropertySet("AdvanceMode", 2);
vMSPowerPoint.OlePropertyGet("ActivePresentation").OlePropertyGet("SlideShowSettings").OlePropertyGet("PointerColor").OlePropertySet("RGB", (255, 0, 0));
vMSPowerPoint.OlePropertyGet("ActivePresentation").OlePropertyGet("SlideShowSettings").OleFunction("Run");
// boucle pour changer de page si la presentation n'est pas programmee en automatique
for (int i = 0; i <= NB_de pages; i++)
{
vMSPowerPoint.OlePropertyGet("ActivePresentation").OlePropertyGet("SlideShowWindow").OlePropertyGet("View").OleFunction("Next");
// inserer une temporisation suffisante pour avoir le temps de visualiser les pages
}
// fonction pour revenir a la page precedente
vMSPowerPoint.OlePropertyGet("ActivePresentation").OlePropertyGet("SlideShowWindow").OlePropertyGet("View").OleFunction("Previous"); |
Partager