Document Editing Problems

Insert Multiple JPEG Files as Full-Slide Images in PowerPoint

Nimra MalikNimra Malik Nov 18, 2026 871 views

Question details

Create a PowerPoint presentation from a folder of JPEG files, placing one image on each slide and stretching it to fill the slide.

Insert Multiple JPEG Files as Full-Slide Images in PowerPoint
Product
Microsoft PowerPoint
Device & OS
not provided
Scenario
A user wants to batch-insert many JPEG files into a presentation without margins around the images.
Observed behavior
The desired result is one JPEG per slide, stretched to cover the entire slide, even if its proportions differ from the slide.
Before you start

Put the JPEG files in one folder and set the presentation's slide dimensions under Design > Slide Size before importing. Stretching images to fill the slide may distort them when their aspect ratios differ from the slide's.

Solution 1Recommended

Use a VBA macro to stretch each JPEG across a slide

Use this method in desktop PowerPoint on Windows to append one full-slide image per JPEG file, including in large batches.

The macro adds blank slides to the end of the active presentation and places one JPG or JPEG file on each. File order is not guaranteed, so check the slide sequence afterward.

1
Open the VBA editor

Open the destination presentation in desktop PowerPoint on Windows, then press Alt+F11. In the VBA editor, select Insert > Module.

2
Add the macro

Paste this code into the module: Sub InsertJPEGsFullSlide() Dim folder As String, fileName As String, ext As Variant Dim sld As Slide, w As Single, h As Single With Application.FileDialog(msoFileDialogFolderPicker) .Title = "Select the JPEG folder" If .Show <> -1 Then Exit Sub folder = .SelectedItems(1) End With w = ActivePresentation.PageSetup.SlideWidth h = ActivePresentation.PageSetup.SlideHeight For Each ext In Array("*.jpg", "*.jpeg") fileName = Dir(folder & "\" & ext) Do While fileName <> "" Set sld = ActivePresentation.Slides.Add(ActivePresentation.Slides.Count + 1, ppLayoutBlank) sld.Shapes.AddPicture folder & "\" & fileName, msoFalse, msoTrue, 0, 0, w, h fileName = Dir() Loop Next ext End Sub

3
Run the import

Return to PowerPoint, select View > Macros, choose InsertJPEGsFullSlide, and select Run. Choose the JPEG folder in the folder picker.

4
Check and save the slides

Review the added slides and their order in Slide Sorter. Use File > Save As and choose PowerPoint Macro-Enabled Presentation (.pptm) if you want to keep the macro in the file.

Macro security: PowerPoint may block macros according to your security settings. Run code only after reviewing it and only when your organization's policies permit it.
Free Microsoft Office alternative

Edit image-based presentations with WPS Presentation

WPS Office is a free, lightweight alternative with a familiar presentation interface. Open compatible PowerPoint files and add or resize images on slides as you migrate your work; it does not fix PowerPoint add-in or macro problems.

Add JPEG images to presentation slides and adjust their size.Open and edit Microsoft PowerPoint PPT and PPTX files.Use a familiar slide-editing interface for an easier transition.Work with a free, lightweight Office alternative.
microsoft office alternative - wps office

Frequently Asked Questions

Why do my images have margins in PowerPoint Photo Album?

Photo Album can fit an image while preserving its proportions. If the image and slide have different aspect ratios, margins may remain. The VBA solution sets each picture to the slide's full width and height instead.

Will stretching a JPEG to fill a slide distort it?

It can. If the JPEG and slide have different aspect ratios, setting both the image width and height to the slide dimensions changes the image's proportions. Set the slide size under Design > Slide Size before importing.

Does the VBA macro replace my existing slides?

No. It adds blank slides at the end of the active presentation, with one JPEG on each new slide. Review the slide order after running it.

How can I keep the macro in my presentation?

Select File > Save As and choose PowerPoint Macro-Enabled Presentation (.pptm). A regular .pptx file can contain the imported slides but cannot retain the VBA macro.