Consulting

Results 1 to 8 of 8

Thread: How to? Insert image as background on slide - 20 slides, 20 images then repeat

  1. #1
    VBAX Newbie
    Joined
    Aug 2020
    Posts
    4
    Location

    How to? Insert image as background on slide - 20 slides, 20 images then repeat

    Hi. Telling you straight up. I'm a beginner. So thanks in advance for all knowledge you pass on.

    Situation:
    I have a 20 slide deck. I have to manually insert an image as the background on each slide... So... Background Styles, Format background, insert picture or texture fill radio button, 'Insert' button as picture choice, select image in finder window, then Insert.

    Repeat for each slide because each slide gets a different background.

    1st Ask: is it possible to automate this? All the images are in the same folder, image-1.png, image-2.png etc.

    2nd Ask: if it is possible, what's the fastest/best way to repeat the process is the image.png files have been updated.

    Any help is greatly appreciated!

    Thanks!

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    It is definitely possible. You might want to add the full path to the folder with images and confirm that the images are named Image-1.png ....Image-20.png.

    It will help if you say that you know (or don't) how to access the vb editor, insert a module and copy in code.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Newbie
    Joined
    Aug 2020
    Posts
    4
    Location
    Thanks John, good to know it's possible.

    So I'm a super beginner. I have no idea where to start with writing the code.

    Could someone get me started?

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    Can you answer the two questions about folder path and image names?
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  5. #5
    VBAX Newbie
    Joined
    Aug 2020
    Posts
    4
    Location
    Hi John,
    My apologies. You were so kind in the phrasing of your initial response, that I didn't realize it was a question


    The images will always follow this nomenclature: Background_slide_1.png, Background_slide_2.png, etc.


    The images will always be in a folder named 'Indesign_PNGs_for_ppt'


    Here is the full path if relavant. ~/Documents/Project-name/PowerPoint/Indesign_PNGs_for_ppt


    Thank you!
    J

  6. #6
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    The code would look like this

    Sub BackG()
    Dim L As Long
    Dim strFolder As String
    'note this will need to be ammended to point to your docs folder
    strFolder = "C:\users\your name\Documents\Project-name/PowerPoint/Indesign_PNGs_for_ppt\"
    For L = 1 To 20
    ActivePresentation.Slides(L).FollowMasterBackground = False
    With ActivePresentation.Slides(L).Background.Fill
    .UserPicture (strFolder & "Background_slide__" & CStr(L) & ".png")
    .Visible = True
    End With
    Next L
    End Sub
    NOTE ~/Documents/Project-name/PowerPoint/Indesign_PNGs_for_ppt IS NOT the full path to the folder and you will need to change the path in the code too.


    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  7. #7
    VBAX Newbie
    Joined
    Aug 2020
    Posts
    4
    Location
    Hi John,
    Thank you so much! I must be doing something wrong. I get a run-time error. Here are snaps of the error, the debug, and my folder structure.
    I should make note: I'm on a mac running PowerPoint for Mac Version 16.40. I'm wondering if I just can't find the right syntax for the absolute path to the folder.
    2020-08-31_12-18-37.jpg
    2020-08-31_11-56-19.jpg
    2020-08-31_12-08-33.png

    Thank you so much for helping!

  8. #8
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    I'm not realloy a lot of help on Macs.

    Try deleting C: from the folder path.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •