Here is the VBA code for PowerPoint: ```vba Sub GenerateVBAForPowerPoint() ' This macro demonstrates how to create a new presentation and add a slide with a title and subtitle Dim pptApp As Object Dim pptPres As Object Dim pptSlide As Object ' Create a new instance of PowerPoint Set pptApp = CreateObject("PowerPoint.Application") pptApp.Visible = True ' Create a new presentation Set pptPres = pptApp.Presentations.Add ' Add a title slide (layout 1 is typically Title Slide) Set pptSlide = pptPres.Slides.Add(1, 1) ' Set the title text pptSlide.Shapes(1).TextFrame.TextRange.Text = "Hello, PowerPoint!" ' Set the subtitle text pptSlide.Shapes(2).TextFrame.TextRange.Text = "Generated with VBA" ' Optional: Save the presentation ' pptPres.SaveAs "C:\YourPath\YourPresentation.pptx" ' Clean up Set pptSlide = Nothing Set pptPres = Nothing Set pptApp = Nothing MsgBox "Presentation created successfully!" End Sub ```
De Wikiprompt, la enciclopedia libre de prompts
Here is the VBA code for PowerPoint: ```vba Sub GenerateVBAForPowerPoint() ' This macro demonstrates how to create a new presentation and add a slide with a title and subtitle Dim pptApp As Object Dim pptPres As Object Dim pptSlide As Object ' Create a new instance of PowerPoint Set pptApp = CreateObject("PowerPoint.Application") pptApp.Visible = True ' Create a new presentation Set pptPres = pptApp.Presentations.Add ' Add a title slide (layout 1 is typically Title Slide) Set pptSlide = pptPres.Slides.Add(1, 1) ' Set the title text pptSlide.Shapes(1).TextFrame.TextRange.Text = "Hello, PowerPoint!" ' Set the subtitle text pptSlide.Shapes(2).TextFrame.TextRange.Text = "Generated with VBA" ' Optional: Save the presentation ' pptPres.SaveAs "C:\YourPath\YourPresentation.pptx" ' Clean up Set pptSlide = Nothing Set pptPres = Nothing Set pptApp = Nothing MsgBox "Presentation created successfully!" End Sub ``` Un prompt para generar código VBA completo para crear diapositivas de PowerPoint con texto centrado y alineado a la izquierda.
Medios relacionados
Contenido del PromptGuardar
Iniciá sesión para ver el prompt completo
Continuar con:
Al iniciar sesión, aceptás nuestros Términos de uso y Política de privacidad
Uso
Este prompt está diseñado para usarse con coding. Copiá el contenido de arriba y pegalo en tu herramienta de IA preferida.
Para mejores resultados, personalizá los marcadores (indicados con corchetes o mayúsculas) con tus requisitos específicos.
Referencias
- Categoría: Prompts de coding
- Fuente: https://x.com/itsPaulAi/status/1690722247684567040
Discusión
0 comentarios