
Howwver this does not work in Powerpoint. Clicking the desired cell in Word table.
Insert pictures into powerpoint slides code#
You can modify the position and size of the image by using the code below: (2). We can add images to table in Microsoft Word. Note: The 4th, 5th, 6th and 7th parameters to the AddPicture function will have no effects in this case. Case 2: Inserting image into a slide with a single image holder:Ĭonsider the slide below that has 1 image holder:īy calling the function, the image will be inserted inside the image holder and it will be resized to fit the image holder. The code above inserts the image located in the path C:\\Users\\Public\\Pictures\\Sample Pictures\\Desert.jpg onto slide number 2. This will open up a File Explorer window from which you can choose an image. From the Images group, click the Picture button.

This tab houses all the options for inserting things like graphs, pictures, and WordArt. Note: By supplying the optional 6th and 7th parameters you can set the width and height of the inserted image respectively. In this article I will explain how you can insert an image into a PowerPoint presentation using VBA. From the options on the top of the PowerPoint window, choose Insert. The 4th and 5th parameters are the distance from the left and top sides of the screen respectively.

The code above will yield the following result: Case 3: Inserting image into a slide with more than one image holder:Ĭase 1: Inserting image into a slide without an image holder:Īs you can see the slide has 2 shapes which are both textboxes.Case 2: Inserting image into a slide with a single image holder:.Case 1: Inserting image into a slide without an image holder:.
