Example output
vba
Copy code
Sub GeneratePresentation()
Dim pptApp As Object
Dim pptPresentation As Object
Dim pptSlide As Object
' Create a new PowerPoint application
Set pptApp = CreateObject("PowerPoint.Application")
pptApp.Visible = True
' Create a new presentation
Set pptPresentation = pptApp.Presentations.Add
' Create the cover slide
Set pptSlide = pptPresentation.Slides.Add(1, 1) ' SlideIndex: 1, SlideLayout: TitleSlide
pptSlide.Shapes.Title.TextFrame.TextRange.Text = "Welcome to Our Glass Distribution Company"
' Create the index slide
Set pptSlide = pptPresentation.Slides.Add(2, 2) ' SlideIndex: 2, SlideLayout: Title and Content
pptSlide.Shapes.Title.TextFrame.TextRange.Text = "Index"
pptSlide.Shapes(2).TextFrame.TextRange.Text = "1. Who Are We?" & vbCrLf & "2. Products" & vbCrLf & "3. Pricing" & vbCrLf & "4. Team" & vbCrLf & "5. Contact"
' Create the "Who Are We?" slide
Set pptSlide = pptPresentation.Slides.Add(3, 1) ' SlideIndex: 3, SlideLayout: TitleSlide
pptSlide.Shapes.Title.TextFrame.TextRange.Text = "Who Are We?"
pptSlide.Shapes(2).TextFrame.TextRange.Text = "We are a distribution company aiming to be the leader in glass selling around the globe. Our unique value proposition is to provide the highest quality handcrafted glass pieces created by our skilled artisans."
' Create the "Products" slide
Set pptSlide = pptPresentation.Slides.Add(4, 1) ' SlideIndex: 4, SlideLayout: TitleSlide
pptSlide.Shapes.Title.TextFrame.TextRange.Text = "Products"
pptSlide.Shapes(2).TextFrame.TextRange.Text = "Our product range includes a wide variety of glassware such as vases, bowls, tumblers, and decorative items. Each piece is meticulously crafted to ensure the highest quality and aesthetic appeal."
' Create the "Pricing" slide
Set pptSlide = pptPresentation.Slides.Add(5, 1) ' SlideIndex: 5, SlideLayout: TitleSlide
pptSlide.Shapes.Title.TextFrame.TextRange.Text = "Pricing"
pptSlide.Shapes(2).TextFrame.TextRange.Text = "Our pricing is competitive and varies based on the complexity, size, and design of the glassware. Please contact our sales team for detailed pricing information."
' Create the "Team" slide
Set pptSlide = pptPresentation.Slides.Add(6, 1) ' SlideIndex: 6, SlideLayout: TitleSlide
pptSlide.Shapes.Title.TextFrame.TextRange.Text = "Team"
pptSlide.Shapes(2).TextFrame.TextRange.Text = "Our team consists of highly skilled artisans, designers, and sales professionals who are passionate about delivering exceptional glassware and ensuring customer satisfaction."
' Create the "Contact" slide
Set pptSlide = pptPresentation.Slides.Add(7, 1) ' SlideIndex: 7, SlideLayout: TitleSlide
pptSlide.Shapes.Title.TextFrame.TextRange.Text = "Contact"
pptSlide.Shapes(2).TextFrame.TextRange.Text = "For any inquiries or to place an order, please contact our sales team at:" & vbCrLf & "Phone: +123456789" & vbCrLf & "Email: sales@example.com"
' Clean up
Set pptSlide = Nothing
Set pptPresentation = Nothing
Set pptApp = Nothing
End Sub
The code above creates a new PowerPoint application, adds a new presentation, and then creates each slide with the specified content. You can run the GeneratePresentation macro to generate the slides. Once the slides are generated, you can apply your desired design using PowerPoint's built-in design options.
Please note that you'll need to enable the Microsoft PowerPoint Object Library reference in your VBA editor to run this code. To do this, go to the VBA editor (Alt+F11), click on "Tools" in the menu bar, then select "References" and check the "Microsoft PowerPoint XX.X Object Library" option (where "XX.X" represents the version number of PowerPoint installed on your system).
Remember to save your presentation manually after generating the slides. Let me know if you need any further assistance!