Club Builder - Foros de discusión Club Builder
Foro de C++Builder en español
 
 FAQFAQ   BuscarBuscar   MiembrosMiembros   Grupos de UsuariosGrupos de Usuarios   RegistrarseRegistrarse 
 PerfilPerfil   Entra para ver tus mensajes privadosEntra para ver tus mensajes privados   EntrarEntrar 

Power Point - Delphi para C++Builder

 
Publicar nuevo tema   Responder al tema    Foros de discusión -> Consultas
Ver tema anterior :: Ver tema siguiente  
Autor Mensaje
Mensaje    Asunto: Power Point - Delphi para C++Builder Responder citando

Necesito ayuda para traducir este código de Delphi para C++Builder


Código:

uses 
  comobj; 
   
procedure TForm1.Button2Click(Sender: TObject); 
var 
  PowerPointApp: OLEVariant; 
begin 
  try 
    PowerPointApp := CreateOleObject('PowerPoint.Application'); 
  except 
    ShowMessage('Error...'); 
    Exit; 
  end; 
  // Make Powerpoint visible 
  PowerPointApp.Visible := True; 

  // Show powerpoint version 
  ShowMessage(Format('Powerpoint version: %s',[PowerPointApp.Version])); 

  // Open a presentation 
  PowerPointApp.Presentations.Open('c:\MyPresentation.ppt', False, False, True); 

  // Show number of slides 
  ShowMessage(Format('%s slides.',[PowerPointApp.ActivePresentation.Slides.Count])); 

  // Run the presentation 
  PowerPointApp.ActivePresentation.SlideShowSettings.Run; 

  // Go to next slide 
  PowerPointApp.ActivePresentation.SlideShowWindow.View.Next; 

  // Go to slide 2 
  PowerPointApp.ActivePresentation.SlideShowWindow.View.GoToSlide(2); 

  // Go to previous slide 
  PowerPointApp.ActivePresentation.SlideShowWindow.View.Previous; 

  // Go to last slide 
  PowerPointApp.ActivePresentation.SlideShowWindow.View.Last; 

  // Show current slide name 
  ShowMessage(Format('Current slidename: %s',[PowerPointApp.ActivePresentation.SlideShowWindow.View.Slide.Name])); 
   
  // Close Powerpoint 
  PowerPointApp.Quit; 
  PowerPointApp := UnAssigned; 
end;




gracias
Volver arriba
Ver perfil de usuario Enviar mensaje privado
Mensaje    Asunto: Responder citando

Código:
    // Añadimos la cabecera:  #include <ComObj.hpp>

    Variant PowerPointApp;
    try {
        PowerPointApp = CreateOleObject("PowerPoint.Application");
    }
    catch(...) {
        ShowMessage("Error...");
        return;
    }

    // Make Powerpoint visible
    PowerPointApp.OlePropertySet("Visible", true);

    // Show powerpoint version
    ShowMessage(Format("Powerpoint version: %s", ARRAYOFCONST((
        PowerPointApp.OlePropertyGet("Version")))));

    // Open a presentation
    Variant ActivePresentation = PowerPointApp.OlePropertyGet("Presentations")
        .OleFunction("Open", "c:\\MyPresentation.ppt", false, false, true);

    // Show powerpoint version
    ShowMessage(Format("%s slides.", ARRAYOFCONST((ActivePresentation
        .OlePropertyGet("Slides").OlePropertyGet("Count")))));

    // Run the presentation
    ActivePresentation.OlePropertyGet("SlideShowSettings").OleProcedure("Run");

    // Go to next slide
    Variant View = ActivePresentation.OlePropertyGet("SlideShowWindow").OlePropertyGet("View");
    View.OleProcedure("Next");

    // Go to slide 2
    View.OleProcedure("GoToSlide", 2);

    // Go to previous slide
    View.OleProcedure("Previous");

    // Go to last slide
    View.OleProcedure("Last");

    // Show current slide name
    ShowMessage(Format("Current slidename: %s", ARRAYOFCONST((
        View.OlePropertyGet("Slide").OlePropertyGet("Name")))));

    // Close Powerpoint
    PowerPointApp.OleProcedure("Quit");
Volver arriba
Ver perfil de usuario Enviar mensaje privado
Mensaje    Asunto: Responder citando

Muchas gracias por tu ayuda. ¡Quedó perfecto!
Volver arriba
Ver perfil de usuario Enviar mensaje privado
Mostrar mensajes de anteriores:   
Cambiar a:  
No puedes publicar temas nuevos en este foro
No puedes responder a temas en este foro
No puedes editar tus mensajes en este foro
No puedes borrar tus mensajes en este foro
No puedes votar en las encuestas de este foro


Hosting WordPress Indedmedia desde 3,99 €
© 2002–2026 Club Builder · Funciona con phpBB.