Got any suggestions?

We want to hear from you! Send us a message and help improve Slidesgo

Top searches

Trending searches

ppt presentation code

61 templates

ppt presentation code

american history

85 templates

ppt presentation code

49 templates

ppt presentation code

17 templates

ppt presentation code

100 templates

ppt presentation code

physical education

96 templates

Programming Presentation templates

If you're the type of person who loves to solve puzzles and think analytically, then programming might just be the perfect hobby for you programming gives you the opportunity to create, explore and work with logic to make all sorts of neat projects, from apps and websites to video games and machinery. enter this wonderful world by checking out our google slides themes & powerpoint templates about programming..

  • Calendar & Weather
  • Infographics
  • Marketing Plan
  • Project Proposal
  • Social Media
  • Thesis Defense
  • Black & White
  • Craft & Notebook
  • Floral & Plants
  • Illustration
  • Interactive & Animated
  • Professional
  • Instagram Post
  • Instagram Stories

Programming Lesson presentation template

It seems that you like this template!

ppt presentation code

Register for free and start downloading now

Programming lesson.

If you teach programming languages and related issues, download and personalize this template to prepare your lesson. The fonts look computer-like, and it’s very creative. Insert some info about the features of the topic, assignments and support them with visual aids, such as bar graphs.

Silicon Valley Programmer Portfolio presentation template

Premium template

Unlock this template and gain unlimited access

Silicon Valley Programmer Portfolio

Download the "Silicon Valley Programmer Portfolio" presentation for PowerPoint or Google Slides. When a potential client or employer flips through the pages of your portfolio, they're not just looking at your work; they're trying to get a sense of who you are as a person. That's why it's crucial to...

Programming Language Workshop for Beginners presentation template

Programming Language Workshop for Beginners

Go from “Hello World!” to a master in programming with this creative template that looks like code line. The amazing design works perfect for a programming workshop because it includes editable resources and a layout that makes understanding code lines a very easy and visual experience. In addition, the color...

Computer Science & Mathematics Major For College: Computer Science & Programming presentation template

Computer Science & Mathematics Major For College: Computer Science & Programming

Show future students the wonders of computer science and what they can achieve if they join a career in this incredible degree. With these slides you can speak about both technical and simple concepts and they will all be quickly understood! Editing them is as easy as printing Hello world!...

Introduction to Java Programming for High School presentation template

Introduction to Java Programming for High School

Teaching programming to High School students is undoubtedly a great way to give them useful and practical skills for life! And to help you out with this task, Slidesgo has created this template for an introduction to Java programming for you. Not only is it extremely attractive with its neon...

All About Programming in Java presentation template

All About Programming in Java

Download the All About Programming in Java presentation for PowerPoint or Google Slides. High school students are approaching adulthood, and therefore, this template’s design reflects the mature nature of their education. Customize the well-defined sections, integrate multimedia and interactive elements and allow space for research or group projects—the possibilities of...

Java Programming Workshop presentation template

Java Programming Workshop

Programming... it's hard, it must be said! It won't be after you use this presentation! If you are an expert in Java and programming, share your knowledge in the form of a workshop. This template is designed for you to include everything you know about Java and show it to...

Abstract Lines Thesis Defense Program Brochure presentation template

Abstract Lines Thesis Defense Program Brochure

The defense of your thesis is a very important step in your professional career, arguably the most important. You already have the first part of the process: having your thesis done. Now, the next step is to stand out in the defense and surprise the jury with your work. A...

Brackets Lesson for Coding and Programming presentation template

Brackets Lesson for Coding and Programming

Learning the basics of coding and programming just got a lot easier with this engaging template about the importance of brackets. Let's go through the basics together, using illustrations and visuals in colorful tones to make the learning process even more fun! From understanding what brackets mean to knowing where...

New Operating System Design Pitch Deck presentation template

New Operating System Design Pitch Deck

Windows, Android, macOS... the list of operating systems is quite long, and without them, we wouldn't have be using electronic devices today. Yeah, no computers, no smartphones! As technology continues to evolve at a rapid pace, there is a growing demand for new and innovative operating systems that can keep...

Introduction to Coding Workshop presentation template

Introduction to Coding Workshop

Have you ever wondered what goes on behind the scenes of your favorite apps, websites, and computer programs? No? That's because you're an expert in coding, and are about to prepare an introductory workshop to coding. Alright! Dive headfirst into this editable template and transform the slides into useful resources...

Bachelor in Robotics Engineering presentation template

Bachelor in Robotics Engineering

Download the Bachelor in Robotics Engineering presentation for PowerPoint or Google Slides. As university curricula increasingly incorporate digital tools and platforms, this template has been designed to integrate with presentation software, online learning management systems, or referencing software, enhancing the overall efficiency and effectiveness of student work. Edit this Google...

Colombian Code and Programming Learning Center presentation template

Colombian Code and Programming Learning Center

Do you know how to program? All the secrets of codes and programming can be mastered if well understood. Maybe a teaching center can help with that! A little bird has told us that you own a Code and Programming Learning Center and you need to present it to new...

Senior Frontend Developer Portfolio presentation template

Create your presentation Create personalized presentation content

Writing tone, number of slides, senior frontend developer portfolio.

Download the "Senior Frontend Developer Portfolio" presentation for PowerPoint or Google Slides. When a potential client or employer flips through the pages of your portfolio, they're not just looking at your work; they're trying to get a sense of who you are as a person. That's why it's crucial to...

Code Hacker Lesson for Middle School presentation template

Code Hacker Lesson for Middle School

Don't let the name mislead you! If you're a middle school teacher and your mission is to educate your students in the use of computers, this template can help you make your lesson more interesting! The visual content revolves around programming (yes, and hackers), so you might want to talk...

Programming Language Master's Degree presentation template

Programming Language Master's Degree

There are many languages. The language of music, the language of feelings or the type of language we are using to describe this template. Okay, you guessed it! The next template is about one type of language. But which one? If we tell you Java or Python you might be...

Introduction to Java Programming Language for Middle School presentation template

Introduction to Java Programming Language for Middle School

Are you ready to take coding to the next level? Java programming may just be the answer you've been searching for. As a versatile language used in engineering and various platforms such as Android, Java is a great language to learn in middle school. With the help of this Google...

Hackathon Minitheme presentation template

Hackathon Minitheme

Download the Hackathon Minitheme presentation for PowerPoint or Google Slides and start impressing your audience with a creative and original design. Slidesgo templates like this one here offer the possibility to convey a concept, idea or topic in a clear, concise and visual way, by using different graphic resources. You...

  • Page 1 of 6

Register for free and start editing online

How to use VBA in PowerPoint: A beginner’s guide

  • Written by: Jamie Garroch
  • Categories: PowerPoint productivity , Presentation technology
  • Comments: 45

ppt presentation code

Here at BrightCarbon we’re always looking for new ways to improve our own PowerPoint productivity and then share that knowledge with the presentation community (that includes you, by the way!). One of the ways we do this is by using VBA code to automate and extend the functionality of PowerPoint. We publish  free PowerPoint VBA code snippets here in our blog for you to use and also offer a PowerPoint automation service . This article explains how to grab the code from our articles and use it in your PowerPoint project, so that you can take your productivity to the next level!

What is VBA?

Visual Basic for Applications (VBA) is a programming environment for Microsoft Office applications. It’s included with your installation of Office by default  ( unless your system administrator has deactivated it ) . PowerPoint VBA provides you with a way to do one of two things   using macros and add-ins:  

  • A utomate  PowerPo int:   If you ever find yourself repeating the same task over and over again, VBA could be your new best friend.  Let’s say you have 100 slides and you need to unhide all hidden objects  across all those slides . That could take you  many  eye-straining minutes, but with a PowerPoint VBA it takes around a  second.
  • E xtend  PowerPoint :   Sometimes PowerPoint doesn’t have the feature you need  to complete your task . As an example, if you end up deleting default layouts from a template, there’s no  easy  way in PowerPoint to get them back. This article includes PowerPoint VBA code to do just that!

How to open the VBE (Visual Basic Editor)

Getting to meet your VBA friend is very simple. With PowerPoint open and at least one presentation file open, press  Alt+F11 * on your keyboard. This will open the VBE (Visual Basic Editor):  

PowerPoint VBE No Modules

*If for some reason Alt+F11 isn’t mapped on your keyboard you can right click anywhere on the ribbon, select  Customize the Ribbon…  and in the window that appears, tick the  Developer Tab  check box over on the right hand side before clicking  OK  to close the window. Now you can click the  Visual Basic  button within this tab:  

PowerPoint Developer Tab Visual Basic

Adding PowerPoint VBA code  

To add some VBA code, you need a container to put it in so go ahead and click  Insert  from the menu and then select  Module :  

PowerPoint VBE Insert Module

You now have a module ready to paste the VBA code into  from one of our blog articles :  

PowerPoint VBE Module Inserted

Copy the VBA code from  the required blog article  by double-clicking on it and then paste it into the  Module1  window above.  Here’s a very simple example of some code  to display a message dialogue :

You should now see something like this:  

PowerPoint VBA

Because this code is just a single  Sub  procedure called  HelloWorld , it’s referred to as a macro.  

Running  the PowerPoint VBA macro  

Now you have the macro in your presentation you can use  Alt+Tab  to return to the more familiar PowerPoint window. From here, the macro can be run by pressing  Alt+F8  on your keyboard  (or b y  clicking the  Macros  button in the Developer tab)  which opens a window containing a list of available macros:  

PowerPoint VBA

Security Soup

The first time you add VBA code to a file, Microsoft assumes that it is safe because you added it. As soon as you save, close and reopen the file, Microsoft doesn’t know that it’s your code so it will disable it by default. You can tell the Office app to allow your code to run either by signing it with a digital certificate (beyond the scope of this article) or by lowering the security setting for the app. You can do this in PowerPoint by clicking File / Options / Trust Center / Trust Center Settings / Macro Settings and selecting this option shown below:

VBA Macro Settings

Saving your file  

ppt presentation code

Once you ’ve added  VBA code  to  your presentation, PowerPoint will  ask you to save it as a  pptm  file  (the ‘m’ stands for macro)  instead of the more  familiar  pptx  format .  You can go ahead and do this to  either  keep a n archive  copy of your  code-enabled  project  or   to  create your personal macro library.  

If you want to distribute your  presentation,   it’s advisable to   save  it  using the familiar pptx format so that  your  recipients don’t see lots of verbose  security  messages  when opening  pptm  files!  

Y ou can  make  your file saveable as a standard presentation again  by  right – click ing  on  each   code module in the  project explorer pane , clicking  Remove   ModuleX …   and either click  Yes   (if you want to keep a backup of the modules independently of your presentation)  or  No   when  asked if you want to save the module before removing it :  

ppt presentation code

Now your presentation doesn’t include any code and you can save it as a pptx file.  

So, there you have it.  You now know how to open the VBE, insert a PowerPoint VBA code module, paste code into it, run the macro and save the file in either pptm  or pptx formats. All you need is a cool macro to make your daily life even easier. Keep checking in with our blog for more useful macros – like this one on restoring default slide master layouts!

Got something extra you’d like PowerPoint to do?

Check out our PowerPoint automation service which provides you with a custom solution to your specific needs.

ppt presentation code

Jamie Garroch

Principal technical consultant, related articles, how to consistently brand graphs and charts across microsoft office.

  • PowerPoint design / PowerPoint productivity
  • Comments: 1

How do you make sure that your graphs and charts have consistent branding across Excel, PowerPoint and Word? Learn how to create and use custom templates that support your brand identity across Microsoft Office.

ppt presentation code

Changes to VBA Macro Security in Microsoft 365

  • Presentation technology / Industry insights
  • Comments: 2

You can do some really cool things in Microsoft Office with just a few lines of Visual Basic for Applications (VBA) - from creating your own custom formula in Excel to correcting branded content in PowerPoint to merging address data for a mail campaign in Word. And sometimes you need to share that VBA solution with colleagues and clients, via the Internet. A change that Microsoft rolled out at the end of March 2022 tweaks the process required by Windows users to gain access to this active content.

ppt presentation code

Protecting your prized PowerPoint content

  • PowerPoint productivity / Presentation technology

Our comprehensive guide to password protecting PowerPoint files so your precious presentations stay just they you made them!

very simple, very explicit, very good help for a beginner vba programmer in powerpoint. Thanks

great resource, thanks. I’ve used VBA for years in MSaccess, and this is a good refresher for me.

I am trying to make a ppt file that loops until stopped. then I save it as a video. the ppt ran and looped continuously. Once recorded as video it stopped looping. do you have code to make ppt work when in video format

Hi Charles. As soon as you export a PowerPoint deck as a video all the PowerPoint functionality is removed as the file is magically transformed into an MP4 file, without VBA (sob sob). The only way to make the video loop is to use the looping feature of your video player.

Yeah, your best off recording a screen capture of the presentation running, then cutting it so it loops perfectly.

You can convert the video into gif file so that it will loop

Hi Jamie, thanks for the clear into, I am very new to this so that really helps. I am trying to develop a VBA macro that looks for the left hand mouse key being pressed and held down for more than two seconds whilst over a shape in slideshow mode. Once this is satisfied (i.e. two second press) for it then to hyperlink or take the user to a specified slide or even the next slide worst case.

I realise there is an automated/ built in feature (Action) that does this type of thing for a mouse click or mouse over but I really need a “long press” to activate if possible.

Any help appreciated.

Hi Simon and thanks for a great question. What you’re looking to do is pretty complex because VBA doesn’t natively support mouse actions in the PowerPoint slide show window. But, it is possible to use a Windows API (hence no Mac compatibility) called GetAsyncKeyState to gain access to mouse button click events. I had a look at this and quickly ran into a brick wall because an action link to a macro in slide show mode (Insert / Action / Mouse Click / Run macro) fires on the mouse up event, not mouse down. That means any corresponding VBA timer code can’t run until after the user releases the button and hence too late to detect if it was held down for two seconds. Maybe something could be done with the mouse over event to simulate what you need to achieve? Another approach could be to use the mouse down event on an invisible userform although that is also getting very involved with multiple Windows APIs. Depending on what you’re trying to do, you could also start the timer on click one, change the colour of the clicked shape and show countdown text before reverting to the original colour. If the user clicks a second time before the time expires, then the hyperlink is fired.

Valuable app

Hello I have a question:

Private Sub CommandButton2_Click() ActivePresentation.FollowHyperlink _ Address:=”http://192.168.16.49/?OUT1=ON”, _ NewWindow:=False, AddHistory:=False ActivePresentation.SlideShowWindow.View.GotoSlide (2)

Now it opens Chrome. but how can i make it that it opens te address en afther that shut down chrome.

Hi Tom. Your example should open the default browser at the URL specified by the Address parameter. For more information on the FollowHyperlink method, see this Microsoft documentation: https://docs.microsoft.com/en-us/office/vba/api/powerpoint.presentation.followhyperlink

Thank you very much! It’s exactly what I needed.

I have tried using your randomizing macro with a powerpoint – I must be doing something wrong, because it isn’t putting the slides in random order. Please advise! I copied the macro exactly (using cut & paste), and thought I was following all the directions here for how to use it in the powerpoint. But, no random presentation of the slides. Boo hoo!

Hi Marya. Let’s check that VBA is installed and enabled on your machine. Can you add the following macro to the VBE project (just below the existing one) and try to run it from the PowerPoint window using Alt+F8?

Sub CheckVBA() MsgBox “it’s working” End Sub

Make sure the quotes are the straight type.

I am trying to format my title page so that the number displayed is equal to the linked slide and updates automatically wherever the slide is moved. For example “about us” is on slide #5 and linked, so it goes to slide 5 when you click on the word. I need the number (in a separate text box) to update automatically to the slide number location that the link goes to.

Hi Mary and thanks for the question. It looks like you’re interested in some kind of automated agenda slide builder. That’s a fair bit of code to create and quite complex as it needs to handle events from PowerPoint to detect when slides have moved. It could be possible to write a simpler macro which you run manually each time you want to update that title page. You’d need start by finding a way to identify which objects are your numerical indicators. For example, if you named your objects in the selection pane (Alt+F10) “Agenda Link”, then is simple macro could be a starting place for you: Sub UpdateAgendaNumbers() Dim oSld As Slide Dim oShp As Shape Dim LinkedSlideIndex As Long On Error Resume Next For Each oSld In ActivePresentation.Slides For Each oShp In oSld.Shapes If oShp.Name = “Agenda Link” Then If oShp.ActionSettings(ppMouseClick).Action = ppActionHyperlink Then If oShp.HasTextFrame Then LinkedSlideIndex = Split(oShp.ActionSettings(ppMouseClick).Hyperlink.SubAddress, “,”)(1) oShp.TextFrame.TextRange.Text = LinkedSlideIndex End If End If End If Next Next End Sub

Great wealth of information. Have never used macros before but was looking to use them to help with this situation. At work we use Work Orders (created in Power Point) and are looking to include a sequential number to them (print 50-100 copies of one slide with the numbers) and if possible would like the number to continue from the last printed number…been trying to find some code to help but not having much luck possible partly due to being new to macros

That’s definitely something we could help design for you Joshua. If you’d like to discuss further, please click the Contact button at the top of this page.

I tried this changing the font color of text within the textbox. I used this to change the font color on a mouse over:

Public Sub GraphicHover(ByRef oGraphic As Shape)

oGraphic.TextFrame.TextRange.Font.Color.RGB = RGB(0, 130, 202)

and it works just fine. But, when I move the mouse off the text box, onto the invisible rectangle with this code attached to the mouseover event, it doesn’t change the text color back to it’s original color and remains the color I changed it to mentioned above. I know the mouseover event is being triggered because I checked “Highlight when mouse over” and I am seeing the highlight on the invisible rectangle:

Public Sub ResetGraphicHover(ByRef oCover As Shape) Dim oSld As Slide Dim oShp As Shape Set oSld = oCover.Parent For Each oShp In oSld.Shapes With oShp.TextFrame.TextRange.Font.Color If .RGB = RGB(0, 130, 202) Then .RGB = RGB(121, 135, 156) End With Next End Sub

Any clue where my ResetGraphicHover is failing?

Hi Dave. I took your code and it works for me. You could add a debug line after the For Each… line in the rest macro to check that (a) it’s firing and (b) which shapes are being looked at on your slide. To do that, add this:

Debug.Print oShp.Name

After you run the slide show, check the output in the VBE Immediate pane (Ctrl+G to toggle it).

Hi I am creating an interactive game (matching cards or concentration) in PowerPoint. If the 2 cards match, I need a pop-up text box to appear. If the 2 cards do not match, I need a sound to play.

I understand I need programming to make this happen. Please help or give alternative ways to achieve this. Thanks.

Hi Tammy. Have a look at this article which will help you: https://www.brightcarbon.com/blog/powerpoint-memory-game/

Hi Producer I will like to get comments on macros you can make available to me. Beautiful. I am using this approach frequently to make offline projects. Thanks. S. Fas

Excellent!!! Thank you!

You’re more than welcome NataĹĄa!

Thank you! Is there any option to replace a font in the entire presentation for a specific character. Let’s say, I would like to change font only for dots in the deck but I would like to keep the rest in the original font. Any idea please? Thank you so much!

Hi Jan. You might be able to use the Replace Fonts feature found in the Home tab of PowerPoint under the Replace menu at the far end of the ribbon. If you need to use VBA then set up a nested loop to iterate all shapes within all slides and then use the oShp.TextFrame2.TextRange.Font object to change the font.

Exellent explenation. so beutiful. I am creating an interactive e learing quiz. Thanking you.

Hello! I have a client who’s interested in using tagging to help create searchable content within slides. For example, they have four different categories for slide content across multiple presentations (Overview, Market, Product, Country). I’d like to assign a different shape to represent each of the four categories, where a blue square might represent Overview slide content. Then, when someone uses the keyword “Overview” to search for overview content (on Teams or SharePoint), these slides are easily identified. Is this something that’s possible with VBA code?

Hi Linda. That’s a very good question! Given the need is to search via SharePoint, VBA probably won’t help here as the PowerPoint file needs to be opened for VBA to examine its content. I have a sneaking suspicion that if you add keywords in the Tags field under File / Info that SharePoint may use this. But, that’s at the file level rather than the slide level. We have a PowerPoint add-in called ShowMaker that might be of interest as it allows you to add category metadata to slides and then the presenter can use that to filter the deck and export the required content. You can find an overview of it here: https://www.brightcarbon.com/showmaker/ and we could set up a demo if you’re interested (please use the Contact button at the top of this page if that’s the case).

I’ve just created an elearning package in PowerPoint using VBA , I didn’t realise it could sum up text boxes within PowerPoint to mark the qualification at the end. Also used AWS text to speech over the top of the learning . Looks great

Sounds like a fun and successful project Stu! Thanks for sharing 🙂

I have a bit of a tricky one but hoping it is possible to do with VBA. We offer training services to multiple clients that can be customized but the majority of training is consistent from one client to the next (main changes are the slide masters/formatting and addition/removal of certain sections).

What we want to do is create one master (or multiple) training document(s), and then use VBA’s to link it to the client specific PowerPoint. We want to link the master rather than using the “reuse slide” command so that if we update one file the other will automatically update as well.

Not sure if it matters, but our company uses sharepoint as storage

Hi Dave and thanks for a great question. VBA is an excellent solution for automating a manual process. In general, if a person can perform a task manually via a sequence of pre-defined steps then VBA can do it automatically, faster, and with less chance of mistakes for something done many times. We’d be happy set up a call to discuss your needs further and see what could be automated with VBA. If that’s of interest, please use the contact button at the top of the page and mention my name in the form.

PP does not seem to have the record macro feature. To write vba code in PP by someone who only worked with vba in excel, would require some prior knowledge. Is there a summary of the most common objects, methods etc to refer to?

Hi Reef. You’re correct that there’s no VBA macro recording feature in newer versions of PowerPoint. The best place to start learning is by purchasing a book (there’s one called “Mastering VBA for Microsoft Office 365” on Amazon or reading the extremely exciting Object Model documentation from Microsoft: https://docs.microsoft.com/en-us/office/vba/api/overview/powerpoint/object-model

Hi Greeting I had made a game in power point using VBA codes. At last it generate a report every time a candidate conduct the game . My requirement is to generate result in same excel sheet after conducting the game. Like Row 1 player 1 result Row 2 player 2 result I need your help Regards

Hi Asheesh. It’s possible to use VBA to get PowerPoint to “talk” to Excel (and other Office apps) but it’s a bit complicated to mention in a comment here. We’d be happy to help if you’d like a quote or if you want to try yourself you could start with this: Set oXL = CreateObject(“Excel.Application”) and have a look at some online examples. I’d also recommend the book “Mastering VBA for Microsoft Office 365” available from Amazon.

If there are two colors of font in the textFrame, how to change the font of one color through VBA?

Hi Bruce. You could either iterate through the Characters collection of the TextRange2 object or the Runs collection which returns all of the TextRanges with the same style. Example: ActiveWindow.Selection.ShapeRange(1).TextFrame2.TextRange.Runs(1).Font.Fill.ForeColor.RGB

Hi – can you help, please?

How can I change the font color and size of the message box? What code will work and where will I put it? Creating an interactive game in powerpoint. Thank you!

—– Sub Correct() Points.Caption = (Points.Caption) + 10 Output = MsgBox(“Your answer is correct, well done!”, vbOKOnly, “Correct Answer”) ActivePresentation.SlideShowWindow.View.Next End Sub

Sub Incorrect() Points.Caption = (Points.Caption) – 5 Output = MsgBox(“Your answer is incorrect.”, vbOKOnly, “Wrong Answer”) ActivePresentation.SlideShowWindow.View.Next End Sub

Sub Reset() SlideLayout.Points.Caption = 0 ActivePresentation.SlideShowWindow.View.Exit End Sub ———-

Thanks for your explanation.

Hi Jamie, Is there any way to keep my macro save in a file so I can utilize on any other PPTs equivalent as.normal.dotm for Word, .xlam(add-in) for Excel.

Hi Anurag. Thanks for the question and Happy New Year! The best way to do this would be to export your project as a ppam and activate it as an add-in via the PowerPoint add-ins UI. Save your ppam in %AppData%\Microsoft\AddIns and then in the Windows PowerPoint Developer tab, click PowerPoint Add-Ins and add your ppam from there. If you’re not code-signing your VBA project, you may need to adjust Trust Centre settings. You could optionally build an EXE/MSI installer package for Windows and PKG for macOS, although that is a more complex topic.

Join the BrightCarbon mailing list for monthly invites and resources

Throughout all stages of this project we have had a world class experience. The team was uber-responsive and open to feedback and collaboration to ensure we were getting the best presentation possible. Marc Chaanine Jamaica Bearings

ppt presentation code

How to Insert Scripts Into PowerPoint: A Step-by-Step Guide

Inserting scripts into PowerPoint can seem daunting, but it’s relatively straightforward! It involves opening the Developer tab, adding a button, and then inputting your script into the button’s ‘Actions’ settings. After you’ve done this, you can run your script directly from your presentation.

Once you’ve completed this action, you’ll have a button in your PowerPoint slide that can execute your script. This can be a great way to add interactive elements to your presentations or automate certain tasks within your slides.

Introduction

PowerPoint is not just for creating slideshows with fancy transitions and flashy graphics. It’s also a powerful tool that can incorporate scripts to make your presentations more interactive and automated. But wait, scripts in PowerPoint? Yes, you heard that right! PowerPoint allows you to insert VBA (Visual Basic for Applications) scripts to perform tasks or actions beyond the standard features of the software. This capability is especially useful for those who create educational content, interactive presentations, or need to automate repetitive tasks in their slides.

Understanding how to insert scripts into PowerPoint can elevate your presentations, making them more dynamic and efficient. It’s not just for the tech-savvy, either. Even if you’re not a programmer, a little bit of scripting can go a long way in enhancing your PowerPoint projects. So, whether you’re a teacher, a business professional, or someone who just loves to create impressive presentations, learning to insert scripts into PowerPoint is a skill worth acquiring.

Step by Step Tutorial on How to Insert Scripts into PowerPoint

The following steps will guide you through inserting a script into a PowerPoint presentation. Each step is crucial, so be sure to follow them carefully.

Step 1: Open the Developer Tab

First things first, you need to enable the Developer tab in PowerPoint.

After enabling the Developer Tab, it will appear on your PowerPoint ribbon, giving you access to more advanced features, including the ability to insert scripts.

Step 2: Add a Button

Next, within the Developer tab, click on the ‘Button’ icon to add a new button to your slide.

Once you’ve added the button, you can resize and move it to your desired location on the slide. This button will serve as the trigger for your script.

Step 3: Input Your Script

After adding the button, right-click on it and select ‘Properties’. In the ‘Properties’ menu, you’ll find an ‘Action’ tab where you can input your script.

This is where you’ll paste or write your VBA script. The script will be executed when you click the button during your presentation.

BenefitExplanation
Enhanced InteractivityScripts enable more interactive presentations, allowing for audience participation and dynamic content.
AutomationYou can automate repetitive tasks in PowerPoint, saving time and ensuring consistency across slides.
CustomizationScripts allow for greater customization of PowerPoint functions, tailoring presentations to specific needs.
DrawbackExplanation
ComplexityFor those unfamiliar with programming, inserting scripts can be complex and intimidating.
Compatibility IssuesScripts may not work properly if the presentation is opened on a different version of PowerPoint or on another device without the necessary permissions.
Potential Security RisksMalicious scripts could pose security risks, so it’s essential to use trusted sources and understand the code being inserted.

Additional Information

Inserting scripts into PowerPoint is a gem of a feature for anyone looking to push the boundaries of their presentations. It’s like having a secret weapon that can turn a good presentation into a great one. But like any feature, it has its quirks. For instance, if you’re planning to share your PowerPoint with others, remember that the scripts might not work on their devices if they have different security settings or PowerPoint versions.

Also, while VBA is powerful, it has its limitations within PowerPoint. Certain tasks and functions that are easy in dedicated programming environments may be more challenging to implement. However, for many users, the ability to automate tasks, create interactive quizzes, or pull data from external sources directly into a slide is worth the initial learning curve.

Remember, if you’re new to scripting, start small. There’s a wealth of resources and communities online that can help you learn the basics of VBA scripting. And once you get the hang of it, you’ll be able to create some truly spectacular presentations with PowerPoint.

  • Enable the Developer tab in PowerPoint.
  • Add a button to your slide via the Developer tab.
  • Input your VBA script in the button’s ‘Properties’ under the ‘Action’ tab.

Frequently Asked Questions

Do i need to know how to code to insert scripts into powerpoint.

Not necessarily. Basic scripts can be implemented with minimal coding knowledge, but more complex tasks may require an understanding of VBA.

Can I insert scripts in PowerPoint on a Mac?

Yes, although the process and features might differ slightly from the Windows version.

Can scripts in PowerPoint be harmful to my computer?

Scripts from trusted sources are usually safe, but be cautious of inserting code from unknown origins as it could contain malicious content.

Can I run scripts in PowerPoint without the Developer tab?

No, the Developer tab is necessary to access the scripting functions in PowerPoint.

Will my scripts work when I share my PowerPoint presentation with others?

Your scripts should work as long as the recipient has the necessary permissions and a compatible version of PowerPoint.

Inserting scripts into PowerPoint can transform your presentations from static slides to dynamic, interactive experiences. Whether you’re looking to automate tedious tasks or create engaging content, understanding the process of adding scripts is undeniably valuable. While it might seem daunting at first, especially if you’re not well-versed in coding, the effort pays off when you see your presentations come to life.

Remember to always use scripts from trusted sources and be aware of the compatibility and security implications. As you become more comfortable with VBA, the possibilities for what you can achieve in PowerPoint are virtually limitless. So, why not take the plunge and add a bit of scripting magic to your next presentation?

Matthew Burleigh Solve Your Tech

Matthew Burleigh has been writing tech tutorials since 2008. His writing has appeared on dozens of different websites and been read over 50 million times.

After receiving his Bachelor’s and Master’s degrees in Computer Science he spent several years working in IT management for small businesses. However, he now works full time writing content online and creating websites.

His main writing topics include iPhones, Microsoft Office, Google Apps, Android, and Photoshop, but he has also written about many other tech topics as well.

Read his full bio here.

Share this:

Join our free newsletter.

Featured guides and deals

You may opt out at any time. Read our Privacy Policy

Related posts:

  • How to Create a MS Excel Script: A Step-by-Step Guide
  • How to Add Page Numbers in Powerpoint 2010
  • How to Save Powerpoint as PDF with Notes
  • Google Sheet Script Editor: How to Master It in Simple Steps
  • How to Set Time for Slides in Powerpoint
  • How to Loop a Slideshow on Powerpoint 2013
  • How to Show Developer Tab – Excel 2010
  • How to Make a Powerpoint Slide Vertical in Powerpoint 2013
  • How to Delete a Slide in Powerpoint 2010
  • How to End Powerpoint on Last Slide in Powerpoint 2010
  • How to Unhide a Slide in Powerpoint 2013
  • What is the Best Microsoft Word Cursive Font?
  • How to Drag Slides From One PowerPoint to Another: A Step-by-Step Guide
  • How to Hide a Slide in Powerpoint 2010
  • How to Insert Slides from Another Presentation in Powerpoint 2010
  • How to Create a PowerPoint Presentation Step by Step: 2024 Guide
  • How to Change Hyperlink Color in Powerpoint 2010 (An Easy 5 Step Guide)
  • How to Enable the Developer Tab in Excel for Mac
  • Can I Convert My Powerpoint to Google Slides?
  • How to View a PDF in PowerPoint: A Step-by-Step Guide

We enable developers to create  .css-b4ka5b{background-image:linear-gradient(140deg, #25B9DA 0%, #1F7FD8 100%);color:transparent;-webkit-background-clip:text;background-clip:text;-webkit-box-decoration-break:clone;} stunning presentations

Take your Code Presentations to the next level with snappify's powerful animation features.

Avatars

Join a community of 32 k+ developers spicing up their content

Trusted by industry leaders around the globe

Create next-level presentations

Say goodbye to boring presentations created with PowerPoint or Keynote. 👋

snappify enables you to create stunning presentations, with first-class support for code snippets.

💡 Share interactive slides so your viewers can easily copy code snippets and interact with links.

Elevate your Technical Content

You’re a developer, looking to create visually engaging infographics for social media?

Use snappify to create stunning visuals of your technical concepts, that will engage your followers and take your social media presence to the next level.

Simplify your Education

Are you a teacher or course creator looking to help your students better understand technical concepts ?

snappify makes it easy to create educational content that lets your students retain information and grasp complex ideas.

Embed Interactive Infographics

snappify enables you to embed your visuals in a way that your viewers can easily copy code snippets or texts.

It’s the perfect way to bring your blog to life or spice up your internal company documentation using rich infographics.

🌈 With support for popular platforms like Hashnode, Notion, and Medium, we ensure that your infographics look great, no matter where they're posted!

Spice up your articles

This is an example article using the embedding functionality of snappify. You can hover over the infographic below and copy the code snippet to give it a try in your own IDE.

User Stories

Get to know our users and learn how they leverage snappify!

Avatar of Rodrigo 🐍🚀

Python educator

"I’ve been presenting my talks with snappify for a while now. And each day it looks less and less likely that I’ll go back to PowerPoint."

Avatar of Michael Bromley

Michael Bromley

Co-founder & CTO

"As a developer running a large open source community, without the time and skills for complex design software, snappify lets me get better results in a fraction of the time."

Avatar of Ndimofor Aretash

Ndimofor Aretash

Web Development Facilitator

"Nowadays, when I think of presenting (anything), I think first of snappify!"

Unleash your design potential with our powerful editor

.css-1prv3zp{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;position:relative;margin-right:var(--chakra-space-3);} .css-13otjrl{width:1em;height:1em;display:inline-block;line-height:1em;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;color:currentcolor;} .css-1xh5ykb{width:1em;height:1em;display:inline-block;line-height:1em;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;color:currentcolor;vertical-align:middle;fill:none;width:1em;height:1em;display:inline-block;line-height:1em;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;color:currentcolor;} add multiple code windows.

Sometimes you want to describe differences in code snippets and point out best practices by comparing them.

.css-xtks34{-webkit-transform:translateY(-3px);-moz-transform:translateY(-3px);-ms-transform:translateY(-3px);transform:translateY(-3px);margin-right:var(--chakra-space-3);} .css-ms62x2{width:1em;height:1em;display:inline-block;line-height:1em;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;color:currentColor;vertical-align:middle;stroke:currentColor;fill:currentColor;width:1em;height:1em;display:inline-block;line-height:1em;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;color:currentColor;} Annotate with Text and Arrows

Ever heard the myth of self explaining code? Pah! 😄

Place explanations (or just funny jokes) beside your snippets and style them to your needs with our powerful rich-text editor .

Additionally, you're able to add arrow elements to point at specific parts of your code.

Avatar of snappify

.css-1ttp4ht{-webkit-transform:translateY(-3px);-moz-transform:translateY(-3px);-ms-transform:translateY(-3px);transform:translateY(-3px);} .css-177wddp{width:1em;height:1em;display:inline-block;line-height:1em;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;color:currentColor;margin-right:var(--chakra-space-3);} Your branding will be on point

If you're sharing your code snippets on social media, a little bit of branding doesn't hurt!

You can add your own avatar and specify a username for X, Github, Instagram or LinkedIn .

Add custom images

Upload custom images and arrange them per drag and drop. Push your creativity to new boundaries!

For example you can add an image of the programming language you're using or place a screenshot of the desired outcome of your code snippet.

Logo of CSS3

Highlight your code in different ways

With snappify you're able to change opacity, blur or gray-out parts of your code so the viewer can focus on what matters .

Of course it's also possible to mark specific lines as added or removed to emphasize a change in the code.

Manage your code snippets in one place

As you build an ever-growing library of code snippets, snappify helps you to keep an overview.

Because your code deserves a .css-c41erm{color:#447ED6;-webkit-animation:animation-fo40za 15s linear infinite;animation:animation-fo40za 15s linear infinite;}@-webkit-keyframes animation-fo40za{0%{color:#44D698;}25%{color:#447ED6;}50%{color:#D644A4;}75%{color:#447ED6;}100%{color:#44D698;}}@keyframes animation-fo40za{0%{color:#44D698;}25%{color:#447ED6;}50%{color:#D644A4;}75%{color:#447ED6;}100%{color:#44D698;}} stunning presentation

Professional

   $ 9 /month

$ 32 /month

1,000 views

Wanna stay up-to-date?

Sign up for our newsletter and we'll keep you updated with news about snappify

Our Mission

Greetings! 👋

We're Anki and Dominik and with snappify we want to provide you the possibility to easily create technical presentations with smooth animations.

Doesn't matter if you create code explanations on social media, technical presentations for your company or smoothly animated videos - we hope you'll find snappify a valuable companion.

Illustration showing Anki and Dominik

Create your next presentation

snappify will help you to create stunning presentations and videos.

This video was created using snappify 🤩

CLAUDIO SENNHAUSER

Boost your productivity with chatgpt and powerpoint.

ppt presentation code

Here’s a quick tip to boost your productivity by letting ChatGPT do the heavy lifting when creating PowerPoint slide decks.

UPDATE: ChatGPT can now create the PowerPoint files directly. You don’t need to use VBA code anymore! Here is my updated video, showing you how much easier the process has become:

If you still interested in learning how to use ChatGPT to produce VBA code, here is the original post:

If you don’t know what VBA is, no worries. It stands for Visual Basic for Applications and is integrated into all Microsoft Office applications, including PowerPoint. And no, you don’t have to be a programmer to make this work for you. Your existing copy/paste skills will do just fine…

Let me show you.

Here are the specific steps to take to boost your productivity when creating PowerPoint slide decks:

Visit ChatGPT and prompt it to write an outline for a PowerPoint presentation. Let’s pretend we want a pitch deck with maximum seven slides to present SmartPet Buddy, a fictitious robotic companion for pets.

The ChatGPT prompt could look like this:

You are an entrepreneur who invented SmartPet Buddy: A robotic companion for pets that offers interactive play, exercise, and monitoring, keeping pets entertained and active even when their owners are away. Real fun for your the whole family...including your best friends.

Write the outline for a slide deck to pitch this amazing product to prospective customers. Tell them about how exciting their lives will be with SmartPet Buddy in the house. Focus on the benefits more so than the features.

Tell your audience what the product does for them and what it means to them in their life rather than what it is by listing feature after feature.

Use no more than 7 slides in this deck.

ChatGPT will then produce the outline for this slide deck, just like we asked it to do.

If you like what ChatGPT presents to you, cool. Otherwise either hit the “Regenerate Response” button — or suggest what kind of modifications you want.

Once you are satisfied with the outline for your slide deck, it’s time to bring VBA into play. We are going to prompt ChatGPT to generate the required VBA code for PowerPoint from the outline:

Now write the VBA code to create the PowerPoint slides for this pitch. Add content that is humorous and whimsical to reflect just how fun the product is.

As always, ChatGPT, our skilled and willing digital assistant, will oblige and create a block of code for us. We can then copy this code and hop over to PowerPoint.

Copy the VBA code ChatGPT generated so you can paste it into PowerPoint's Visual Basic Editor.

In PowerPoint, launch the Visual Basic Editor by pressing Alt-F11 or selecting Visual Basic Editor from the Tools/Macro menu.

To get your VBA code into PowerPoint, launch the Visual Basic Editor by pressing Alt-F11 (or select it from the Tools -> Macro menu).

Then, right click on the Project Panel and select Insert -> Module.

Insert a module by right-clicking on the Project panel in the Visual Basic Editor.

A new window will open. Paste the code you copied from ChatGPT into this window and then run the code by clicking on the ► icon.

Once you inserted the code (the real magic to make PowerPoint and VBA do the heavy lifting), run the code by clicking on the 'play' icon or choose it from the Run menu.

And that’s it!

This piece of code has now created a new PowerPoint presentation with 7 slides with minimal text on each.

Now all that’s left is to make it pretty by using PowerPoint’s Designer feature:

Here is where the real magic happens to make your slides pretty by using PowerPoint and VBA. Open the Designer to see a list of suggested designs based on your content.

The Designer is powered by AI as well and will read your slides and suggest a appropriate designs and images.

All you need to do is to select one of the designs you like. Then, fine-tune each slide to make sure your message will resonate with your audience — and voila… You have created a beautiful slide deck in no time.

In case you’re having trouble with the code, here is the snippet that worked for me:

Get instant access to my newsletter where I share my best presentation tips.

100% Privacy. No Spam.

RECENT PRESENTATION TIPS

Don't say "That's a Great Question" and boost your credibility--instead of losing it.

Why You Should Avoid Saying “That’s a Great Question”

Virtual Card Magic for Online Presentations

Virtual Card Magic for Online Presentations

Preparation and coaching were key for Haley McClain Hill's Shark Tank success

10 Key Takeaways from a Shark Tank Success Story

PowerPoint Cameo - Banner

Enter the Spotlight with PowerPoint Cameo

ChatGPT Voice - Your Universal Translator

ChatGPT Voice – A Translator in Your Pocket

ppt presentation code

RELATED PRESENTATION TIPS

Where to Start When Creating an Investor Pitch

Where to Start when Creating an Investor Pitch

Stay in the loop.

Join my mailing list to get exclusive tips and updates to become a presentation pro.

I never share your contact info. And you can unsubscribe at any time.

  • PRIVACY POLICY

Copyright 2024 Š All rights Reserved.

Code Presentation Tips

Sometimes, I need to show some code in my slides. It can be an internal presentation for 3-5 developers, an online meetup, or a live event. And many times, I have found myself trying to recover the lost code style configuration or to recreate a color palette from the previous presentation.

I’ve decided to save all the templates and share them and some tips about code in slides with you. I hope it will help you to create code slides quicker and better.

Know Your Tools #

Logos

Get familiar with the tools for code formating and syntax highlight.

Popular choices for many languages are JetBrains IDEs or VS Code . There also some useful extensions for IDEs that can help you to take screenshots directly from the editor, such as Code screenshots or Polacode .

General-purpose text editors #

I use Sublime Text . It supports syntax highlight for many languages and has a lot of helpful extensions. Mine most often used commands for work with small pieces of code are Set syntax: %language_name% to use syntax highlight for a particular language in the current file and Reindent Lines to apply auto-indentation. Both commands can be accessed through the command menu by Ctrl/Command + Shift + P shortcut.

Online tools #

The best online tool I’ve seen so far is Carbon . It supports many languages, has many color themes, modern design, and it offers a lot of options for color theme configuration.

Those are my favorite tools to create a formatted and visually appealing piece of code, but there are other products in the market. What else do you use? Please, share your setup in comments!

Prepare Format & Highlight Presets #

No Highlight

Prepare and save the configuration for your editor.

It is possible to import and export code style configurations for IntelliJ Idea. For convenience, I store them in GitHub repository: Idea Config . You can apply this code style configuration in Settings → Editor → Code Style → Scheme → Import Scheme → IntelliJ IDEA code style XML and selecting your config file. The same menu allows you to export the current scheme. Create your config, save it in a repository, and use it when you need to have your code style in IDE.

Also, I store color schemes for Carbon . Carbon has many ready-to-use themes, but you can customize and share your configurations. You can find my configs and instructions on how to apply them here: Carbon Config .

Have Dark And Light Presets #

Dark and Light

Create presets for both light and dark environments.

I like the white code on a dark background, and usually, I use this theme for personal projects. But a couple of times, I had to redo a big presentation with a lot of code just because of the requirements from event organizers. It is convenient to have presets for two themes: dark and light. This way, you can quickly rewrite all your slides and adjust your presentation.

Choose Suitable Language #

Java

This problem may occur only when your presentation content is not about one particular technology. But if you are talking about a problem that can be solved and demonstrated in any programming language, then it is better to use a more suitable programming language.

For example, the Spark application can be written both in Java and Scala, but the Scala version almost always will be shorter and more expressive.

Keep It Short #

Long

Long code is acceptable only when you want to demonstrate how awful the long code looks.

Respect the time and effort of your audience. Leave only the code that shows the idea. Don’t include things that do not solve the problem of your slide, such as logging, error handling, imports, comments, etc. Also, don’t hesitate to replace a long or uninteresting block of code with comment or pseudocode.

Remember that simplicity is achieved not when there is nothing to add, but when there is nothing to take away.

Useful Links #

Carbon code image share tool — https://carbon.now.sh/ .

Codestyle templates — https://github.com/smyachenkov/code-slides-config .

  • Python Course
  • Python Basics
  • Interview Questions
  • Python Quiz
  • Popular Packages
  • Python Projects
  • Practice Python
  • AI With Python
  • Learn Python3
  • Python Automation
  • Python Web Dev
  • DSA with Python
  • Python OOPs
  • Dictionaries

Creating and updating PowerPoint Presentations in Python using python – pptx

python-pptx is library used to create/edit a PowerPoint (.pptx) files. This won’t work on MS office 2003 and previous versions.  We can add shapes, paragraphs, texts and slides and much more thing using this library.

Installation: Open the command prompt on your system and write given below command:

Let’s see some of its usage:

Example 1: Creating new PowerPoint file with title and subtitle slide.

               

Adding title and subtitle to the powerpoint

Example 2: Adding Text-Box in PowerPoint.

                           

Adding text box to the powerpoint

Example 3: PowerPoint (.pptx) file to Text (.txt) file conversion.

           

ppt presentation code

Example 4: Inserting image into the PowerPoint file.

                   

Adding images to the powerpoint

Example 5: Adding Charts to the PowerPoint file.

                   

Adding charts to the powerpoint

Example 6: Adding tables to the PowerPoint file.

           

Adding table to the powerpoint

Please Login to comment...

Similar reads.

  • python-modules
  • python-utility
  • California Lawmakers Pass Bill to Limit AI Replicas
  • Best 10 IPTV Service Providers in Germany
  • Python 3.13 Releases | Enhanced REPL for Developers
  • IPTV Anbieter in Deutschland - Top IPTV Anbieter Abonnements
  • Content Improvement League 2024: From Good To A Great Article

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

AutomateExcel Logo

AutoMacro: Ultimate VBA Add-in

VBA Code Helper

Read all reviews

Return to VBA Code Examples

PowerPoint VBA Macro Examples & Tutorial

ppt presentation code

Editorial Team

ppt presentation code

Reviewed by

Steve Rynearson

In this Article

VBA PDF (Free Downloads)

Save as macro-enabled presentation, enable ‘developer’ tab in the ribbon, create powerpoint macro, powerpoint application, open a new presentation, open an existing presentation, open and assign to a variable, refer to active presentation, save current presentation, close current presentation, useful references, assign existing presentation (by name) to variable, assign active slide to variable, assign slide by index to variable, count number of slides, get slide index number of current slide, add a blank slide to end of slide show, add a slide after current slide, delete a slide, go to a specific slide, loop through all slides, loop through all shapes of active slide, loop through all shapes in all slides, loop through all textboxes of active slide, loop through all textboxes in all slides, copy selected slides to new ppt presentation, copy active slide to end of active presentation, change slide during slide show, change font on all slides in all textboxes, change case from upper to normal in all textboxes, toggle case between upper and normal in all textboxes, remove underline from descenders, remove animations from all slides, save presentation as pdf, find and replace text, export slide as image, resize image to cover full slide, exit all running slide shows, open powerpoint – early binding, open powerpoint – late binding, make application visible, maniplulate powerpoint, close the application, copy from excel to powerpoint, powerpoint vba faqs.

This is a complete guide to automating PowerPoint using VBA (Visual Basic for Applications) Macros.  Below you will find many useful examples.

Download our free Microsoft PowerPoint VBA Tutorial! Or VBA Tutorials for other Office Programs!

vba powerpoint tutorial pdf

PowerPoint VBA (Macros) Tutorial

The Presentation with VBA code should be ‘Saved As’ PowerPoint Macro-Enabled Presentation (*.pptm)

vba powerpoint macro enabled

You should to enable the Developer tab on the Ribbon before creating VBA code. To do so choose File -> Options then click on ‘Customize Ribbon’ and check the box next to ‘Developer’ tab in the right pane.

powerpoint vba developer ribbon

This is a simple example of a PowerPoint VBA Macro:

It saves the active presentation as a PDF. Each line of code does the following:

  • Creates variables for the PowerPoint name and PDF name
  • Assigns the active presentation name to pptName variable
  • Creates the full PDF name
  • Saves the presentation as a PDF

When VBA code is running within a PowerPoint Presentation, PowerPoint Application is the default application and it can be manipulated without explicitly reference. Create a New Presentation

To create a presentation, use the Add method of PowerPoint application.

To open a new and blank presentation use the Add method of Application.Presentations collection

To open a presentation which you have already created, use the Open method of Application.Presentations collection

The code above assumes that the presentation is in the same directory as the PowerPoint Presentation containing the code.

You should assign the presentation you open to a variable so that you can manipulate it as per your requirements.

Use the reference ActivePresentation to manipulate the Presentation active in the GUI when the VBA code is executed.

The statement below will save the Active Presentation if it was saved before. It it has not been saved then you will be prompted with the ‘Save As’ dialog.

The statement below will close the Active Presentation even if it was not saved after the last edit.

You can move a slide from its old position to the new position

You can do something with each slide or go through all slides to find a few slides and do something about with using the code;

The power of PowerPoint can be realized by using ‘Shapes.’ The code below loops through all the shapes on the current slide so that you can manipulate them as you want;

You can loop through all the shapes in the presentation by adding a loop to go through all slides.

TextBoxes are the most often used Shape in PowerPoint presentations. You can loop through all the Text Boxes by adding a check for ‘Shape Type.’ TexBoxes have the shape type defined as the VBA constant msoTextBox (the numerical value of the constant is 17)

Again, you can loop through all the textboxes in the presentation by adding a loop to go through all slides.

To copy certain slides to a new presentations, first select the desired slides in the existing presentation and then run the code below;

Useful PowerPoint Macro Examples

Here are some useful macro examples showing how to do tasks. These will also demonstrate the concepts described above.

In typography, a descender is the portion of a letter that extends below the baseline of a font. In most fonts, descenders are reserved for lowercase characters such as g, j, q, p, y, and sometimes f.

When you underline text, it does not look nice under descenders. Here is the code to remove underline from all such characters g, j, p, q, and y in the whole Presentation.

Use the code below to remove all animations set in a Presentation.

You can easily save Active Presentation in PDF format.

You can find and replace text in All TextBoxes of All Slides. After the fist instance of the text you want to find (defined by findWhat) you need to loop through the Find command to find other instances, if any.

You can export Current SLide (or any other slide) as a PNG or JPG (JPEG) or BMP image.

If you have multiple Slide Shows open at the same time then you can close all of them using the macro below.

Automating PowerPoint from Excel

You can also connect to PowerPoint though other applications (like Excel and Word). As as first step, you must refer to an instance of PowerPoint.

There are two ways of doing it – early binding and late binding .

In ‘Early Binding’ you must explicitly set a reference to ‘Microsoft PowerPoint 16 Object Library’ (for MS Office 2019) in the VBE (Visual Basic Editor) using the option Tools->References.

In ‘Late Binding’ application variable is declared as an object and VBA engine connects to the correct application at run time.

After setting the reference to PowperPoint application, you may need to make it visible.

You can use all the methods to manipulate presentations, from within PowerPoint, described above from Excel by just adding the reference to PowerPoint created by you above.

For example

has to be used liked this

Once you have completed what you wanted to do with the PowerPoint application you must close it and should release the reference.

This code will copy a range from Excel to PowerPoint:

Note : It has been kept as simple as possible to show how a range from Excel can be copied to PowerPoint using VBA.

What are macros in PPT?

A Macro is a general term that refers to a set of programming instructions that automates tasks. PowerPoint (PPT) Macros automate tasks in PowerPoint using the VBA programming language.

How do I use VBA in PowerPoint?

To use VBA in PowerPoint, open the VBA Editor (ALT + F11 or Developer > Visual Basic).

How do I create a Macro in PowerPoint?

1. Open the VBA Editor (ALT + F11 or Developer > Visual Basic) 2. Go to Insert > Module to create a Code Module 3. Type ‘Sub HelloWorld’ and press Enter 4. In between the lines ‘Sub HelloWorld’ and ‘End Sub’, type ‘MsgBox “Hello World!’ 5. You’ve created a Macro! 6. Now press ‘F5’ to run the Macro

Written by: Vinamra Chandra

vba-free-addin

VBA Code Examples Add-in

Easily access all of the code examples found on our site.

Simply navigate to the menu, click, and the code will be inserted directly into your module. .xlam add-in.

(No installation required!)

Free Download

automacro

AutoMacro: VBA Add-in with Hundreds of Ready-To-Use VBA Code Examples & much more!

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

How can I embed programming source code in Powerpoint slide and keep code highlighting?

Is it possible to embed programming source code to Powerpoint slide, and keep code highlighting/coloring?

  • microsoft-powerpoint
  • source-code

anderas's user avatar

  • what application are you copying from? –  user1931 Commented Dec 21, 2009 at 4:26
  • I use textmate, e-texteditor and eclipse the most. –  Yousui Commented Dec 21, 2009 at 4:58
  • 2 Please copy your code to VC Code, and then paset to ppt –  Mohammad Fallah Commented Oct 12, 2023 at 17:13

11 Answers 11

After pasting, a small "Paste Options" icon appears below the pasted text.

Click this icon and choose "Keep Source Formatting" :

enter image description here

  • 3 I don't see such a Paste Options icon. I don't see a button to give me these options. I'm using PowerPoint:mac 2011. I think I have seen it in Windows versions, however. –  Asclepius Commented Jul 19, 2013 at 21:49
  • I tried different suggested methods and tools to copy from, but was actually missing that word/powerpoint was messing up the format by using "Destination Theme". Thanks! –  Tim Büthe Commented Jan 22, 2014 at 11:23

Use Notepad++ with add-on NppExport.

Select the source code

Use Copy RTF to clipboard of NppExport

Paste into empty PPT slide (do not select any textfiled)

Jawa's user avatar

  • 8 With version 6.9.2 or higher it's working without NppExport plugin. Just make right-click on the selected text -> Plugin commands -> Copy Text with Syntax Highlighting. –  Ivan Kochurkin Commented Aug 7, 2016 at 19:00
  • 2 Current version of Notepad++ already comes with this plugin :) –  fabriciorissetto Commented Nov 27, 2016 at 17:53
  • 1 Still working in NPP v8.2.1, Power Point 2016 –  iroiroys Commented Mar 16, 2022 at 6:08
  • Direct copy to PowerPoint did not worked well, I paste the code to Word and copy it from word to PowerPoint –  Alireza Fattahi Commented Aug 28, 2023 at 4:45

Pygments can format almost every format to rtf:

schlamar's user avatar

  • 3 An online translator is available at pygments.org/demo –  koppor Commented Nov 25, 2015 at 11:48
  • 6 Same idea, straight to the OS X clipboard pygmentize -f rtf code.py | pbcopy . –  Christian Long Commented Mar 14, 2016 at 14:28
  • Thanks for this. I got very favorable results with pygmentize -O style=paraiso-dark -f rtf -l aspx-cs Index.cshtml | pbcopy for syntax highlighting of a Razor view for use in a presentation. –  Asbjørn Ulsberg Commented Jun 20, 2019 at 20:42
  • Adding to what @ChristianLong suggested, but for Linux: pygmentize -f rtf code.py | xclip -sel clip . Note that you will probably have to install xclip. –  Matthew Cole Commented Nov 19, 2019 at 23:16

If the source code does not need to be copied and pasted out of the presentation, a quick and dirty solution could be to simply take screenshots of the source code.

Emory Bell's user avatar

  • 13 Image can be fuzzy when zoom in. –  Yousui Commented Dec 21, 2009 at 4:58
  • Use the magnifier and then take a screenshot of that. –  wbeard52 Commented May 17, 2015 at 0:57
  • 4 Doing so can increase the size of the presentation file significantly. –  Rufflewind Commented Nov 10, 2016 at 17:39
  • 1 This also has the drawback that once screenshot, it is no longer possible to resize the column width. This becomes a problem if you try to fit a 80 column printout into a 2x1 horizontal slide layout, a 132 column source into a 1x2 vertical layout, for example. The pygmentize answer above doesn't suffer from this. –  Matthew Cole Commented Nov 19, 2019 at 22:55
  • Click on Insert → Object → OpenDocument Text
  • Paste on opened panel
  • Click outside.

Note: Copying from Notepad++ will preserve colors and styling.

random's user avatar

  • 1 Doesn't work for power point 2010. I copied text from Notepad++ to Power point presentation but it looses colors and styling. –  ART Commented Jan 4, 2016 at 5:11
  • 2 If I use NPPExport pluging and use "copy RTF to clipboard" and then paste it works. –  ART Commented Jan 4, 2016 at 5:13

Copy the code and first paste that code into Microsoft word

enter image description here

Then do the formatting if necessary and then copy from word and paste back to powerpoint by right clicking and choosing use destination theme

enter image description here

  • Either way,  what does “Then do the formatting if necessary” mean? –  Scott - Слава Україні Commented Apr 26, 2017 at 19:10
  • It means if you want to do some changes of your own like aligning or indentation of code –  selftaught91 Commented Apr 26, 2017 at 19:17
  • This was the only way that I could copy and paste code from IntelliJ (a special program used for writing code) –  robert Commented Nov 14, 2019 at 4:15

Here's another approach:

  • https://emn178.github.io/online-tools/syntax_highlight.html
  • https://pinetools.com/syntax-highlighter
  • Paste the code to highlight into the web site.
  • Copy the highlighted version.
  • Create a new Word document.
  • Paste the code into Word (note the background colours may be lost).
  • Copy the code from Word.
  • Create a new text area in PowerPoint.
  • Click the Home menu option.
  • Open Paste on the ribbon.
  • Select Keep source formatting .
  • Optionally, change the text area background colour to taste.

Adjust the font using Inconsolata or other monospace font.

Dave Jarvis's user avatar

Online syntax highlighter like TextMate seems good as well, http://markup.su/highlighter/

But after pasting into PowerPoint presentation new lines and line spacing is lost, so we can take a screen shot of the preview and paste it in our PowerPoint presentation

Mohammed Abdul Mateen's user avatar

  • Pasting into ppt does not quite work here on Windows 10: The new lines are not pasted. –  koppor Commented Nov 24, 2015 at 15:22

Using Notepad++ and Npp Export works great, but your text will end up with a white background.

To remove it, paste first the text in word with the "preserve source formatting" option. Then, select the text and in Home > Font, remove the background with the Text Highlight Color option.

Then, copy again the text from word, and paste it in powerpoint with the "preserve source formatting" option.

John's user avatar

Pasting from Eclipse should retain formatting if the app supports it. I know Word does... not sure about PPT.

Chris Nava's user avatar

  • 1 Works from Eclipse Juno to Word 2010, but not to Powerpoint 2010 - it loses the colours and converts some of them to bold text –  DNA Commented Sep 4, 2013 at 17:21

I've had no success pasting into Powerpoint 2010 on Windows.

However, pasting from Eclipse into Word 2010 works.

You can then save this formatted text as an RTF file, then embed the RTF into a Powerpoint 2010 slide using Insert Object (and optionally select 'link' so you can edit and update the text in Word).

DNA's user avatar

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged microsoft-powerpoint source-code ..

  • The Overflow Blog
  • Where does Postgres fit in a world of GenAI and vector databases?
  • Mobile Observability: monitoring performance through cracked screens, old...
  • Featured on Meta
  • We've made changes to our Terms of Service & Privacy Policy - July 2024
  • Bringing clarity to status tag usage on meta sites

Hot Network Questions

  • Where to donate foreign-language academic books?
  • Using \tl_put_right with grouping from latex3 explsyntax
  • I overstayed 90 days in Switzerland. I have EU residency and never got any stamps in passport. Can I exit/enter at airport without trouble?
  • What is the name of this simulator
  • Background for the Elkies-Klagsbrun curve of rank 29
  • Is this a mistake or am I misunderstanding how to calculate a capacitor's impedance with ESR and ESL?
  • Stuck on Sokoban
  • Which version of Bitcoin Core do I need for a Dell laptop with Ubuntu?
  • The answer is not wrong
  • Suitable Category in which Orbit-Stabilizer Theorem Arises Naturally as Canonical Decomposition
  • Who was the "Dutch author", "Bumstone Bumstone"?
  • Parody of Fables About Authenticity
  • Why there is no article after 'by'?
  • Why was this lighting fixture smoking? What do I do about it?
  • What unique phenomena would be observed in a system around a hypervelocity star?
  • My school wants me to download an SSL certificate to connect to WiFi. Can I just avoid doing anything private while on the WiFi?
  • Are the any polls on the opinion about Hamas in the broader Arab or Muslim world?
  • Reference request: acceleration/curvature of curve in metric space
  • Why does a halfing's racial trait lucky specify you must use the next roll?
  • How do we reconcile the story of the woman caught in adultery in John 8 and the man stoned for picking up sticks on Sabbath in Numbers 15?
  • about flag changes in 16-bit calculations on the MC6800
  • How does the summoned monster know who is my enemy?
  • Reusing own code at work without losing licence
  • Why does Jesus give an action of Yahweh as an example of evil?

ppt presentation code

PowerPoint: Inserting Source Code with Syntax Highlighting

Jun 10, 2021 08:46 ¡ 139 words ¡ 1 minute read.

When giving talks, I often want to show some small code samples on my slides. Of course, it should look nice and have syntax highlighting. This is not an easy feat. There are several options for showing code on your slides:

  • You can use a presentation software that can manage source code highlighting out of the box, e.g. Reveal.js or the LaTeX beamer package
  • You can convert the code to an image via Carbon or Codeimg .

But, if you, like me, want to continue using PowerPoint (the whole company is using PowerPoint & we often combine slides from different slide decks), there is another very easy option available: Just put your code into VS Code , enable syntax highlighting, and then copy-paste the code into PowerPoint. The formatting - including syntax highlighting - will stay intact magically. Just awesome 😍

  • Add an image
  • Draft and add content
  • Rewrite text
  • Chat with Copilot
  • Create a summary
  • Copilot in Word on mobile devices
  • Create a new presentation
  • Add a slide or image
  • Summarize your presentation
  • Organize your presentation
  • Use your organization's branding
  • Copilot in PowerPoint for mobile devices
  • Draft an Outlook email message
  • Summarize an email thread
  • Suggested drafts in Outlook
  • Email coaching
  • Create meeting invitation from an email discussion
  • Get started with Copilot in Excel
  • Identify insights
  • Highlight, sort, and filter your data
  • Generate formula columns
  • Text Insights in Excel
  • Summarize your OneNote notes
  • Create a to-do list and tasks
  • Create project plans in OneNote

ppt presentation code

Create a new presentation with Copilot in PowerPoint

Note:  This feature is available to customers with either a Copilot for Microsoft 365 (work) or Copilot Pro (home) license.

Using the on-canvas experience

Note:  This feature is currently rolling out to Microsoft 365 Insiders and will be coming soon for all Copilot subscribers. If you don't see it yet, you can still create presentations with Copilot Chat .

Create a new presentation in PowerPoint.

Select the  Create a presentation about...  option in the  Copilot  menu above your slide.

Screenshot of Copilot button above PowerPoint slide.

Complete the prompt with a description of the presentation you'd like Copilot to help you draft.

Screenshot of prompt input to create a presentation with Copilot.

Review and modify the topics that Copilot generates for you.  To refine your prompt and regenerate a new set of topics, select the pencil   button.

Screenshot of list of topics generated by PowerPoint Copilot.

Add a topic by selecting the   button, then describe your topic.

Screenshot of the Add More with Copilot feature in PowerPoint Copilot.

If you're happy with your topics, select  Generate slides  and Copilot will draft a presentation for you!

Create a presentation with Copilot Chat

Note:  This feature is currently available for all Copilot subscribers.

Create a new presentation in PowerPoint.

Select the Copilot button in the Home tab of the ribbon.

Screenshot of the Copilot in PowerPoint button in the ribbon menu

Select or type Create a presentation .

Screenshot of the prompt menu in Copilot in PowerPoint with the Create a presentation about option highlighted

Complete the prompt with what you would like Copilot to help you draft.

Screenshot of the compose box in Copilot in PowerPoint with a Create a presentation about hybrid best practices prompt

Select Send and Copilot will draft a presentation for you!

Edit the presentation to suit your needs, ask Copilot to add a slide , or start over with a new presentation and refine your prompt to include more specifics. For example, "Create a presentation about hybrid meeting best practices that includes examples for team building."

Create a presentation with a template

Copilot can use your existing themes and templates to create a presentation. Learn more about making your presentations look great with Copilot in PowerPoint .

Open an existing presentation with your theme or create a new presentation using a theme or template from File > New or Office.com .

Screenshot of theme selection for a new presentation on Office.com.

Enter your prompt or select Create presentation from file to create a first draft of your presentation using your theme or template.

Copilot will replace your current presentation with a new one. If needed, s ave a copy first and rerun the steps above. If you already have a copy, confirm with Copilot to proceed with creating your new draft.

Screenshot of a warning in Copilot in PowerPoint about how creating a new presentation will replace existing slides

Edit the presentation to suit your needs, ask Copilot to add a slide , organize your presentation, or add images.

Create a presentation from a file with Copilot

Note:  This feature is available to customers with a Copilot for Microsoft 365 license for full options, or a Copilot Pro license for limited options.

Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.

With Copilot in PowerPoint, you can create a presentation from an existing Word document—or a PDF if you have a Copilot for Microsoft 365 (work) license. Point Copilot in PowerPoint to your document, and it will generate slides, apply layouts, create speaker notes, and choose a theme for you.

Select or type Create presentation from file .

Screenshot of the Copilot in PowerPoint prompt menu with Create a presentation from file option highlighted

Select the document you want from the picker that appears. If you don't see the document you want, start typing any part of the filename to search for it. You can use a Word document—or, if you have a Copilot for Microsoft 365 (work) license, you can use a PDF, and encrypted documents are available as well.

Note:  If the file picker doesn't appear, type a front slash (/) to cause it to pop up.

Best practices when creating a presentation from a Word document

Leverage word styles to help copilot understand the structure of your document.

By using Styles in Word to organize your document, Copilot will better understand your source document structure and how to break it up into slides of a presentation. 

Include images that are relevant to your presentation

When creating a presentation, Copilot will try to incorporate any images in your Word document. If you have images that you would like to be brought over to your presentation, be sure to include them in your Word document.

Start with your organization's template

If your organization uses a standard presentation template, start with this file before creating a presentation with Copilot. Starting with a template will let Copilot know that you would like to retain the presentation's theme and design. Copilot will use existing layouts to build a presentation for you. Learn more about making your presentations look great with Copilot in PowerPoint .

Tip:  Copilot works best with Word documents that are less than 24 MB.

Frequently Asked Questions

Select a heading for more information. ​​​​​​​ 

What is the create a presentation feature in PowerPoint?

The PowerPoint Copilot create a presentation feature helps the user get started with creating a designed presentation in PowerPoint. Users can create a presentation with their own prompt or by referencing a file.

What are the feature’s capabilities?

The create a presentation feature streamlines the creation process by understanding the content the user is trying to create, whether by prompt or referenced file, and creating a designed presentation that gets the user started. When creating a presentation from the Copilot button above the slide, PowerPoint Copilot also helps the user create a narrative and steer the output of their presentation by allowing the user to add, remove, and reorder topics before presentation generation.

What is the feature’s intended use?

The create a presentation feature is designed to help get PowerPoint users started in their creation process.

How was the create a presentation feature evaluated? What metrics are used to measure performance?

The feature is evaluated through a combination of comparative analysis, human review, automated testing, red teaming, and customer engagement metrics. User feedback and presentation kept rates gauge the effectiveness of generated presentations. End-users provide ongoing feedback on each Copilot feature, along with iterative improvements that contribute to optimizing the system's performance across all features.

What are the limitations of this feature? How can users minimize the impact of the feature’s limitations when using the system?

When creating a presentation using a prompt, only a single output language is supported at a time. When creating a presentation by referencing a file, additional context cannot be provided within the same prompt. The user must have access to and permission to use the file they are referencing to create a presentation. The output of the create a presentation feature is AI generated content and should be reviewed and edited by the user accordingly,

What operational factors and settings allow for effective and responsible use of the feature?

Data privacy and security : Implement robust data privacy measures to protect customer information and ensure compliance with relevant regulations. Use secure communication channels and encryption methods to safeguard sensitive data.

User training and guidelines : Provide comprehensive training to users on the system's features, capabilities, and limitations. Establish clear guidelines and best practices for responsible and ethical use, emphasizing the importance of accurate representation, respectful communication, and adherence to legal and ethical standards.

User permissions and access control : Implement role-based access control to limit system functionalities and data access based on user roles and responsibilities. Ensure that users have appropriate permissions aligned with their job responsibilities and authorized access to customer data.

Monitoring and auditing : Regularly monitor system usage, interactions, and outcomes to identify any potential issues or concerns. Conduct periodic audits to assess adherence to guidelines, data protection measures, and ethical practices.

Feedback and continuous improvement : Encourage users to provide feedback on system performance, accuracy, and user experience. Actively seek user input to understand their needs and identify areas for improvement. Regularly update the system based on feedback and advancements in technology.

Transparency and explainability : Foster transparency by clearly communicating to users how the system works, the underlying technologies used, and any limitations or potential biases. Ensure that users have a basic understanding of the system's capabilities and are informed about its AI-powered nature.

Accountability and error correction : Establish mechanisms for addressing errors or inaccuracies that may occur in system-generated content. Encourage users to review and correct any inaccuracies, taking responsibility for the final output, and ensuring it aligns with their knowledge and expertise.

The Create a Presentation feature, as well as Copilot in PowerPoint more generally, has undergone responsible AI reviews prior to release. We are open to user feedback to make continuous improvements. We strive to follow Microsoft’s AI principles and have, for example, implemented: 

Responsible AI handling pipeline to mitigate the risks like harmful, inappropriate content.

In product user feedback with which users can report offensive content back to Microsoft. ​​​​​​​

Welcome to Copilot in PowerPoint

Frequently Asked Questions about Copilot in PowerPoint

Where can I get Microsoft Copilot?

Copilot Lab - Start your Copilot journey

Facebook

Need more help?

Want more options.

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

ppt presentation code

Microsoft 365 subscription benefits

ppt presentation code

Microsoft 365 training

ppt presentation code

Microsoft security

ppt presentation code

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

ppt presentation code

Ask the Microsoft Community

ppt presentation code

Microsoft Tech Community

ppt presentation code

Windows Insiders

Microsoft 365 Insiders

Find solutions to common problems or get help from a support agent.

ppt presentation code

Online support

Was this information helpful?

Thank you for your feedback.

Create PowerPoint Presentations with ChatGPT: 4 Easy Ways

Bryan Gamero

You probably know that ChatGPT is a powerful AI tool for generating text and answering questions. However, it can do much more than that. In fact, ChatGPT is changing how we approach presentation design.

Crafting professional PowerPoint presentations can be time-consuming and challenging, especially if you’re not a design expert. Luckily, ChatGPT makes it easier, helping you save time and create high-quality, engaging presentations.

In this article, we’ll explore how to use ChatGPT to create a PowerPoint Presentation. Let’s look at three simple ways ChatGPT can improve your presentation process.

Keep scrolling for step-by-step instructions, or check out the screenshots and GIFs to make the most of using ChatGPT for presentations.

Our design presentation services

Here are the topics we'll cover:

Can ChatGPT make a PowerPoint?

Why use chatgpt for powerpoint presentations.

  • How to use ChatGPT to create a PowerPoint presentation?

Tips for Using ChatGPT to Create Presentations

Why 24slides beats ai in presentation design.

Technically, no. ChatGPT doesn't create PowerPoint files directly and can't design visual elements. However, it can be a useful tool in the presentation creation process.

ChatGPT can help you create content, suggest slide outlines, and provide ideas to enhance your presentation. Here are some other ways ChatGPT can save you time and effort in creating your next PowerPoint:

  • ChatGPT can generate VBA code to create slides. Although the slides may be basic, they can be a good starting point for your presentation.
  • Don’t know where to start? The AIPRM extension helps you get the most out of ChatGPT with ready-made prompts for your next PPT. 
  • Want to maximize any AI presentation tool ? ChatGPT can help you craft the perfect prompt. The AI tool will then turn ChatGPT's output into a PowerPoint presentation.

Later, I’ll show you how to use ChatGPT to generate a PowerPoint presentation for each of these methods.

Using ChatGPT can be a game-changer for creating PowerPoint presentations. Here’s why:

  • Save Time: Making a presentation not only requires effort but also time. ChatGPT quickly provides content, speeding up the process and saving you from starting from scratch.
  • Enhance Content: It helps refine your message, suggest improvements, and create engaging text. It also simplifies complex concepts for your slides.
  • Generate Ideas: ChatGPT gives you fresh ideas and unique insights for your slides, helping you present your material in a more compelling way.
  • Automate Tasks: ChatGPT can generate VBA code to automate repetitive tasks, like formatting and slide design. This makes it easier to handle large presentations.
  • Ensure Consistency: ChatGPT ensures consistency in language, quality, and tone, giving your presentation a professional touch. It also minimizes grammar and language errors, making your slides clear and well-written.
  • Seamless Integration: With tools like the AIPRM extension , you can use pre-made prompts to get a jump start on creating effective presentations.

How to use ChatGPT to create a PowerPoint presentation

Now that we know ChatGPT helps create PowerPoint presentations, let's explore the different ways we can use it. 

Feel free to explore the method you find most useful!

  • Use ChatGPT for Slides Outline and Content
  • Use ChatGPT to Create a PowerPoint Using VBA Codes
  • Use ChatGPT AIPRM Extension to create a PowerPoint

Use ChatGPT with an AI Presentation Tool

1. use chatgpt for slides outline and content.

ChatGPT can help you brainstorm and outline your slides. You can generate detailed content for each slide by providing key points to cover in your presentation.

Step 1: Ask ChatGPT for a Table of Contents

First, you need a strong prompt. It should clearly state the topic, audience, objective, and slide count to ensure the content is relevant, well-organized, and has the right tone.

Use this ChatGPT prompt format:

“As an expert in [field/topic], create an outline for a PowerPoint presentation on [list of topics] for [target audience]. The objective is [state the objective]. Structure it to fit [number] slides. Use a [tone/style] tone.”

Here’s an example:

ChatGPT's output for a PowerPoint presentation

Step 2: Refine the ChatGPT Output

Once the outline is created, you have a good starting point to refine the content. You can expand or reformulate the information on each slide. The goal is to help ChatGPT get the result you're looking for.

Use this ChatGPT prompt to improve the content:

"Please expand the information for each slide. Include interesting facts to enhance engagement and provide more value."

ChatGPT's second output for our PowerPoint presentation

Step 3: Add ChatGPT content to your PowerPoint

Once you have the content for your slides, you can transfer it directly to your PowerPoint presentation. Just copy and paste the content generated by ChatGPT, making sure you keep the structure.

Format the text by adjusting fonts and sizes to match your slide design. Here’s an example:

ChatGPT output for a PowerPoint presentation final result

You now have a great starting point. From here, You’ll need to add design elements and media, plus adjust the layout and content to enhance visual appeal.

2. Use ChatGPT to create a PowerPoint using VBA codes

By using ChatGPT to provide VBA code, you can streamline the process of creating presentations. But before we start, let's answer this question:

What is VBA?

VBA, or Visual Basic for Applications, is a programming language that automates tasks in Microsoft Office apps like PowerPoint. By using ChatGPT, you can quickly generate VBA code to create and customize PowerPoint presentations, making the process faster and easier.

Step 1: Ask ChatgPT for the VBA PowerPoint code

You can use a ChatGPT prompt like "Write me VBA PowerPoint codes on [topic]..." However, the more detailed your explanation of the content, the better the result will be. Here’s an example:

Write me a VBA code for a PowerPoint presentation on [list of topics] for [target audience]. As an expert in [field/topic], structure it to fit [number] slides with a [tone/style] tone. The objective is [state the objective].

Then, ChatGPT will provide an output like this:

VBA Code for a PowerPoint presentation on Digital Marketing

This is the code used to create a presentation in Powerpoint.

Step 2: Open PowerPoint and copy the VBA code

  • Open PowerPoint and press ALT + F11 to open the VBA editor.
  • Go to Insert > Module to create a new module.
  • Copy and paste the code into the module.

Using ChatGPT to create a PowerPoint using VBA codes

Step 3: Create and refine the PowerPoint Presentation

  • Press F5 to run the code and create the presentation.
  • Check the content and make changes as needed.

Use ChatGPT to create a PowerPoint using VBA codes

Of course, we will need to add images and media. If needed, you can ask ChatGPT for more information and repeat this process to generate a new VBA code.

3. Use ChatGPT AIPRM Extension to create a PowerPoint

This is one of the easiest methods to simplify your PowerPoint creation process. There's no need for any ChatGPT prompts. But first, let's answer this question:

What is AIRPRM?

AIPRM is an extension designed to enhance ChatGPT's capabilities for creating and refining content, including PowerPoint presentations. 

This AI tool provides pre-made ChatGPT prompt templates to streamline your PowerPoint creation process. With AIPRM, users get automated suggestions, better formatting, and tailored content within the ChatGPT interface.

Using AIPRM Extension for PowerPoint

  • Step 1: Open your browser and search for "AIPRM ChatGPT prompts." You can use this link .
  • Step 2: Download and install the AIPRM extension.
  • Step 3: Log in to your ChatGPT account.

Once the extension is installed, your ChatGPT interface will have new options and templates. Here’s an example:

AIPRM ChatGPT Prompts

  • Step 4: Type “PowerPoint” in the search bar. This will give you a list of AIRPRM ChatGPT prompts for PowerPoint.

AIPRM ChatGPT Prompts for PowerPoint

  • Step 5: Select a prompt and click on it. It will appear in the chat bar.

AIPRM ChatGPT Prompt for PowerPoint

  • Step 6: Follow the format. Add the presentation topic and VBA instruction. In this prompt, the format is as follows: PowerPoint, Slides, VBA.

For this example, I will use Digital Marketing, 10, VBA.

AIPRM ChatGPT Chat Bar

  • Step 7: Hit Enter. ChatGPT will generate a VBA code as in the previous method (#2).

Using AIPRM Extension for PowerPoint

After ChatGPT generates the VBA codes, paste the code into the Visual Basic Editor in PowerPoint. Next, run the code to generate the slides. To do this, follow the steps in the previous method (#2). 

Here’s a summary:

  • Open PowerPoint.
  • Press Alt + F11 to open the VBA editor.
  • Insert a new module by clicking Insert > Module.
  • Press F5 to run the macro and create the presentation.

Step 1. Choose Your AI Presentation Tool:

  • Research and choose the best AI presentation tool for your needs. Our last article, “ 10 Best AI Tools for Creating Impactful Presentations ,” can help you.

For this example, I will use Gamma. In our review, this AI maker scored 4.5/5 for ease of use. Additionally, it offers a free plan. Use this link to sign up.

Gamma AI Presentation Tool

Step 2. Ask ChatGPT for a Presentation Outline

  • First, you need a strong prompt. To ensure accuracy, I’ll reuse the prompt from method #1

Chatgpt output for a digital marketing presentation

  • Once you have the outline, you can refine and expand the content for each slide. The aim is to help ChatGPT generate the best results.

Use a ChatGPT prompt like this to improve the initial output:

"Please expand the information for each slide. Include interesting facts to enhance engagement and provide more value." 

Step 4. Copy and paste the ChatGPT output into the AI tool

Since we're using Gamma for this example, here's what we'll do:

  • In Gamma, choose “ Paste in text .” You already have the outline from ChatGPT.
  • Copy and paste the ChatGPT prompt and click “ Continue .”
  • Set the number of “ Cards ” to match your slides.
  • Click “ Continue ”.

Using ChatGPT with Gamma AI Presentation Maker

Step 5. Generate and Refine Your PowerPoint Presentation

  • Select your favorite theme and click “ Generate .”
  • Wait a moment while Gamma AI generates the presentation.
  • Review the slides and refine the content.

Creating a presentation with ChatGPT and Gamma AI

You have a strong starting point. Enhance the visual appeal by adding media, adjusting the layout, and refining the content.

  • Use Specific Prompts: The more detailed your prompt, the better the result will be. You should clearly mention the topic, audience, objective, and the number of slides. This will keep the content relevant.
  • Understand ChatGPT’s Capabilities: ChatGPT excels at generating content but doesn't create visuals or handle design elements. Since Chat GPT doesn't have a presentation maker, you'll need to complement its outputs.
  • Review the Content: Always review and edit the generated content to ensure it is accurate, coherent, and aligned with your presentation goals. ChatGPT can make mistakes, so check important info.
  • Refine Your Output: Even if you're very specific, it's hard to get the perfect content for your presentation on the first try. Feel free to adjust your prompts based on initial outputs. The first outputs often highlight what is needed for the best outcome.
  • Integrate ChatGPT into Your Workflow: Refining an existing idea is easier than starting from scratch. Use ChatGPT to generate fresh ideas and create outlines for your presentation. You can tailor your prompts based on your specific experience and needs. Additionally, consider using VBA code to automate repetitive tasks like summarizing information and creating bullet points.

AI tools like ChatGPT are excellent for generating content and speeding up the design process. However, refining prompts to achieve a decent result can be time-consuming. In contrast, 24Slides lets you create a professional, on-brand presentation with just a few clicks.

In our AI vs. professional designer comparison , it's clear that the perfect prompt isn’t enough. You’ll still need many adjustments for a polished result. Most AIs don't fully understand the context of your command or what you really have in mind.

At 24Slides , we believe nothing can replace the human touch in crafting standout presentations. With 10+ years of experience and more than 200 designers worldwide , we are the world’s largest presentation design company.

Unlike AI tools, our world-class designers understand your needs deeply. They ensure that each slide is not only visually appealing but also aligned with your brand and message. 

Want to see what we can do? Try us out for just $1. We’ll design a custom, editable one-slide presentation that truly reflects your brand for just one dollar!

Don't miss this incredible deal – from $43 down to $1!

Try us out for just $1

Looking for more info? Check out these articles!

  • 10 Best AI Tools for Creating Impactful Presentations
  • AI vs. Professional Presentation Designer: A Comprehensive Comparison
  • The Ultimate Guide to Pick the Perfect Presentation Design Agency For You
  • 8 Questions to Ask Before Hiring a Presentation Design Agency
  • Discover the Top 15 Presentation Design Agencies & Services to Use in 2024

Create professional presentations online

Other people also read

How To Write Effective Emails That Will Improve Your Communication

How To Write Effective Emails That Will Improve Your Communi...

24Slides

How to Make a Marketing Plan Presentation in PowerPoint

Alternative presentation styles: Takahashi

Alternative presentation styles: Takahashi

Ceri Savage

How to Code Presentation Template

The How to Code Presentation Template for PowerPoint is a presentation deck with 9 slides to be used in presentations on learn to code. The How to Code template can be used to prepare a presentation describing different components of programming and coding techniques or programming courses. Programming is a skill that is a necessity for the present time. Frequently, various institutions offer courses and diplomas in programming or coding. For such institutions, this How to Code Template is the best choice.

The slides contain icons and colorful graphics of people, computer equipment, etc. Each presentation template slide explains a different aspect of programming and coding. For instance, the Developer slide discusses the essential characteristics of being a full-stack developer. The Code Editor slide can either point to the details of code editors available or a comparison between different code editors or IDEs like Visual Studio Code (VSCode), SublimeText, etc. Similarly, other slides can be edited to present features of the training organization or present the advantages of Pair programming techniques. For instance, the Pair Programming slide shows the graphic of two people with PCs; this can be used to describe the concept and significance of pair programming in general. There is another slide with a visual displaying an online meeting for the students who want to learn coding via online mode.

There are two additional slides for any additional content about the topic, one with a coding icon and the other with the title: ‘Learn to Code.’ Also, there is a data-driven chart to showcase any statistics about the institute or a general trend of various code editors so far. Another application of this template is helping you prepare a project proposal for investors to launch a programming institution. It can also help prepare a presentation about computer Programming for educational purposes.

This template’s icons, shapes, and designs give users the freedom to decorate their projects. They can edit and rearrange the shapes, change the colors and font styles, etc. The How to Code Presentation Template can be edited on Google Slides well.

Title Slide for How To Code Template

You must be logged in to download this file.

Favorite Add to Collection

3 votes, average: 3.67 out of 5

Subscribe today and get immediate access to download our PowerPoint templates.

Related PowerPoint Templates

Spotlight Slide PowerPoint Template

Spotlight Slide PowerPoint Template

Hackathon Planning Process PowerPoint Template

Hackathon Planning Process PowerPoint Template

Curve of Forgetting PowerPoint Template

Curve of Forgetting PowerPoint Template

STAR Team Leadership Model PowerPoint Template

STAR Team Leadership Model PowerPoint Template

ppt presentation code

  • Create a presentation Article
  • Save Article
  • Design Article
  • Share and collaborate Article
  • Give a presentation Article
  • Set up your mobile apps Article
  • Learn more Article

ppt presentation code

Create a presentation

Create a presentation in PowerPoint

Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.

Create presentations from scratch or start with a professionally designed, fully customizable template from Microsoft Create .

Tip:  If you have Microsoft Copilot it can help you create a presentation, add slides or images, and more. To learn more see  Create a new presentation with Copilot in PowerPoint.

Open PowerPoint.

In the left pane, select New .

Select an option:

To create a presentation from scratch, select Blank Presentation .

To use a prepared design, select one of the templates.

To see tips for using PowerPoint, select Take a Tour , and then select Create , .

Create new PowerPoint

Add a slide

In the thumbnails on the left pane, select the slide you want your new slide to follow.

In the  Home tab, in the  Slides  section, select  New Slide .

In the Slides section, select Layout , and then select the layout you want from the menu.

PowerPoint slide layouts

Add and format text

Place the cursor inside a text box, and then type something.

Select the text, and then select one or more options from the Font section of the Home tab, such as  Font , Increase Font Size , Decrease Font Size ,  Bold , Italic , Underline , etc.

To create bulleted or numbered lists, select the text, and then select Bullets or Numbering .

PowerPoint format text

Add a picture, shape, and more

Go to the  Insert  tab.

To add a picture:

In the Images section, select Pictures .

In the Insert Picture From menu, select the source you want.

Browse for the picture you want, select it, and then select Insert .

To add illustrations:

In the Illustrations section, select Shapes , Icons , 3D Models ,  SmartArt , or Chart .

In the dialog box that opens when you click one of the illustration types, select the item you want and follow the prompts to insert it.

Insert Images in PowerPoint

Need more help?

Want more options.

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

ppt presentation code

Microsoft 365 subscription benefits

ppt presentation code

Microsoft 365 training

ppt presentation code

Microsoft security

ppt presentation code

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

ppt presentation code

Ask the Microsoft Community

ppt presentation code

Microsoft Tech Community

ppt presentation code

Windows Insiders

Microsoft 365 Insiders

Find solutions to common problems or get help from a support agent.

ppt presentation code

Online support

Was this information helpful?

Thank you for your feedback.

IMAGES

  1. How to Code Presentation Template

    ppt presentation code

  2. How to Code Presentation Template

    ppt presentation code

  3. Coding PPT Template

    ppt presentation code

  4. How to Code Presentation Template

    ppt presentation code

  5. How to Code Presentation Template

    ppt presentation code

  6. Embed Code in PowerPoint Slide with Carbon.now

    ppt presentation code

VIDEO

  1. Start your PowerPoint Presentation with this fantastic features || PowerPoint

  2. You Can Code in Powerpoint???

  3. The Presentation Experience, Roblox GAME, ALL SECRET CODES, ALL WORKING CODES

  4. Code Refactoring Animated PowerPoint Slides

  5. How to create PowerPoint presentations using chatGPT

  6. How to use QR Code Add-ins in PowerPoint 2021/365

COMMENTS

  1. Free templates about Programming for Google Slides & PPT

    Download the All About Programming in Java presentation for PowerPoint or Google Slides. High school students are approaching adulthood, and therefore, this template's design reflects the mature nature of their education. Customize the well-defined sections, integrate multimedia and interactive elements and allow space for research or group ...

  2. How to use VBA in PowerPoint: A beginner's guide

    Unlock your PowerPoint productivity with VBA: learn how to grab the code from our articles and use it in your PowerPoint project!

  3. Creating a PowerPoint Presentation using ChatGPT

    You can run the code and obtain a PowerPoint file in the following steps. Firstly, open your PowerPoint application and create a new presentation. Then, you should find "Visual Basic Editor" in the "Tools" menu, under "Macro" submenu. Launching Visual Basic Editor. You should see a "VBAProject" window in the Visual Basic Editor.

  4. How to Insert Scripts Into PowerPoint: A Step-by-Step Guide

    Learn how to bring your presentations to life by easily inserting scripts into PowerPoint with our step-by-step guide. Get started now!

  5. From CHATGPT to a POWERPOINT presentation! Step-by-step guide

    Learn how to turn the power of CHATGPT into a dynamic PowerPoint presentation with this step-by-step guide! 😨 In this video, I'll walk you through the proce...

  6. snappify

    Create next-level presentations Say goodbye to boring presentations created with PowerPoint or Keynote. 👋 snappify enables you to create stunning presentations, with first-class support for code snippets.

  7. Automate PowerPoint Slides Creation with Python

    Do you spend more time creating PowerPoint presentations than analyzing data? With Python, you can automate the creation of these presentations and focus on what matters — improving your logistics operations.

  8. Create Beautiful PowerPoint Slides with ChatGPT and VBA

    Then, right click on the Project Panel and select Insert -> Module. A new window will open. Paste the code you copied from ChatGPT into this window and then run the code by clicking on the icon. And that's it! This piece of code has now created a new PowerPoint presentation with 7 slides with minimal text on each.

  9. Code Presentation Tips

    Sometimes, I need to show some code in my slides. It can be an internal presentation for 3-5 developers, an online meetup, or a live event. And many times, I have found myself trying to recover the lost code style configuration or to recreate a color palette from the previous presentation. I've decided to save all the templates and share them and some tips about code in slides with you. I ...

  10. Creating and updating PowerPoint Presentations in Python using python

    python-pptx is library used to create/edit a PowerPoint (.pptx) files. This won't work on MS office 2003 and previous versions. We can add shapes, paragraphs, texts and slides and much more thing using this library.

  11. PowerPoint VBA Macro Examples & Tutorial

    Saves the presentation as a PDF PowerPoint Application When VBA code is running within a PowerPoint Presentation, PowerPoint Application is the default application and it can be manipulated without explicitly reference. Create a New Presentation To create a presentation, use the Add method of PowerPoint application. Application.Presentations.Add

  12. How can I embed programming source code in Powerpoint slide and keep

    Is it possible to embed programming source code to Powerpoint slide, and keep code highlighting/coloring?

  13. AI Powerpoint

    Create working Powerpoint presentations you can refine and customize in under a minute, using our powerful AI generator.

  14. Programming Powerpoint Templates and Google Slides Themes

    Take your programming presentations to the next level with a programming PowerPoint template. Whether you're a coding enthusiast, a computer science student, or a software developer, these templates will help you deliver your technical concepts with clarity and creativity. With a range of customizable slides, you can easily manage your code ...

  15. PowerPoint: Inserting Source Code with Syntax Highlighting

    This is not an easy feat. There are several options for showing code on your slides: You can use a presentation software that can manage source code highlighting out of the box, e.g. Reveal.js or the LaTeX beamer package. You can convert the code to an image via Carbon or Codeimg. But, if you, like me, want to continue using PowerPoint (the ...

  16. How to Create PowerPoints with ChatGPT (Step-by-Step)

    ChatGPT Tutorial — How to Create a POWERPOINT Presentation: A YouTube tutorial by Mike Wheeler demonstrating the process of creating a PowerPoint with ChatGPT.

  17. Add beautiful source code examples with Carbon in your presentations

    Using Powerpoint Objects (Insert > Object > Create new). Select Microsoft Word Document and paste the code. Using tools like Notepad++ (Window users). From Notepad++, select all your code and from menu use Plugin commands and Copy Text with Syntax Highlighting. Paste it with the option Keep Source Formatting into MS Word.

  18. Create a new presentation with Copilot in PowerPoint

    Create a presentation with a template Copilot can use your existing themes and templates to create a presentation. Learn more about making your presentations look great with Copilot in PowerPoint.

  19. How to Use ChatGPT to Create a PowerPoint Presentation

    Step 3: Create and refine the PowerPoint Presentation. Press F5 to run the code and create the presentation. Check the content and make changes as needed. Of course, we will need to add images and media. If needed, you can ask ChatGPT for more information and repeat this process to generate a new VBA code.

  20. Anyone can code

    Cody is a free template designed for presentations about coding. You can use it for "Code Week", a "Women who code" conference, or other topics if you like its layouts.

  21. How to Code Presentation Template

    The How to Code Presentation Template for PowerPoint is a presentation deck with 9 slides to be used in presentations on learn to code. The How to Code template can be used to prepare a presentation describing different components of programming and coding techniques or programming courses. Programming is a skill that is a necessity for the ...

  22. Embed a presentation in a web page or blog

    Open your presentation in PowerPoint for the web. On the File tab of the Ribbon, click Share, and then click Embed. To create the HTML code to embed your file in the web page, click Generate . In the Embed box, under Dimensions, select the correct dimensions for the blog or web page. Under Embed Code, right-click the code, click Copy, and then ...

  23. Create a presentation in PowerPoint

    Training: Watch and learn how to create a PowerPoint presentation, add/format text, and add pictures, shapes, and/or charts.