Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-25-2018, 04:31 AM
hs1972 hs1972 is offline Saving each slide as jpg with the text in the slide as file name Windows 10 Saving each slide as jpg with the text in the slide as file name Office 2010 32bit
Novice
Saving each slide as jpg with the text in the slide as file name
 
Join Date: Jan 2018
Posts: 4
hs1972 is on a distinguished road
Default Saving each slide as jpg with the text in the slide as file name


I have a powerpoint file where I want to save each of the individual slides as jpgs. That bit is fine. The issue is I want the file names to be the text on the individual slide. So if a slide has the text 'Hello There' I want the slide to save as hello-there.jpg (all in lower case, up to 25 characters). Is there any way to do this? Is there any sample VBA script that anyone is aware of that does something similar so I'm not starting from scratch. I'm pretty new to this but willing to give it a go. Know a little VBA. Thanks in advance.
Reply With Quote
  #2  
Old 04-25-2018, 04:47 AM
JohnWilson JohnWilson is offline Saving each slide as jpg with the text in the slide as file name Windows 7 64bit Saving each slide as jpg with the text in the slide as file name Office 2016
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

This might give you a start (assumes you are looking at Title text)

Code:
Sub exporter()
Dim osld As Slide
Dim strFolder As String
Dim strName As String
On Error Resume Next
strFolder = Environ("USERPROFILE") & "\Desktop\Slides\"
MkDir strFolder
For Each osld In ActivePresentation.Slides
If osld.Shapes.HasTitle Then
If osld.Shapes.Title.TextFrame2.HasText Then
strName = osld.Shapes.Title.TextFrame2.TextRange
strName = Replace(strName, " ", "-")
Else
strName = "Slide_" & CStr(osld.SlideIndex)
End If
Else
strName = "Slide_" & CStr(osld.SlideIndex)
End If
Call osld.Export(strFolder & strName & ".jpg", "JPG")
Next osld
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials

Last edited by JohnWilson; 04-25-2018 at 07:00 AM.
Reply With Quote
  #3  
Old 04-25-2018, 04:52 AM
hs1972 hs1972 is offline Saving each slide as jpg with the text in the slide as file name Windows 10 Saving each slide as jpg with the text in the slide as file name Office 2010 32bit
Novice
Saving each slide as jpg with the text in the slide as file name
 
Join Date: Jan 2018
Posts: 4
hs1972 is on a distinguished road
Default

Thank you very much for such a prompt response. This is brilliant; gives me a really good starting point. Thanks again.
Reply With Quote
  #4  
Old 04-25-2018, 06:21 AM
JohnWilson JohnWilson is offline Saving each slide as jpg with the text in the slide as file name Windows 7 64bit Saving each slide as jpg with the text in the slide as file name Office 2016
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Can you go back to your cross post and note that you have a solution elsewhere. Otherwise someone may be wasting time on it right now.

http://www.vbaexpress.com/forum/show...e-as-file-name
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
Reply

Tags
jpg, save text, text



Similar Threads
Thread Thread Starter Forum Replies Last Post
Editable text box in master slide not appearing once closing master slide mode tparnicott PowerPoint 1 06-17-2016 04:13 AM
Saving each slide as jpg with the text in the slide as file name Lyric slide show - using a variable to pull text from next slide elfman12 PowerPoint 3 03-08-2013 12:27 AM
Saving each slide as jpg with the text in the slide as file name Text typed on slide x ports to slide y automatically? Thinker PowerPoint 5 07-26-2012 11:59 PM
Saving each slide as jpg with the text in the slide as file name slide image wont copy with text to new slide lewis.mulhollen PowerPoint 1 12-17-2011 03:17 AM
PP 2010 .avi file plays during slide show, but causes the slide show to loop to begin VictorS PowerPoint 0 10-16-2010 10:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft