File names when saving as JPG

G

Glenn Alcott

I am writing a VB program to automate the saving of Powerpoint
presentations as JPG files. This is working fine, but I have a
question about the file names of the exported JPGs. They are being
named with the word "slide" followed by a sequential number, i.e.,
"slide1.jpg", "slide2.jpg", etc. What I want to know is whether this
file naming scheme is always used, or if there are any circumstances
where the JPG files would be named differently. I am doing some
further processing on these files which will be a lot easier if I know
what file names to expect.

Glenn
 
K

Kathy J

Unless you run specific code to change the names of the files, the jpg files
will always be named as you indicate. The count will follow sequentially.

One thing to note: If you are saving the entire presentation, PPT will
create a folder (named with the name of the presentation) to hold the
slidex.jpg files.

--
Kathryn Jacobs, Microsoft MVP PowerPoint and OneNote
Get PowerPoint answers at http://www.powerpointanswers.com
Cook anything outdoors with http://www.outdoorcook.com
Get OneNote answers at http://www.onenoteanswers.com

I believe life is meant to be lived. But:
if we live without making a difference, it makes no difference that we lived
 
G

Glenn Alcott

Is there some code I could use to change the way it names the files? The
reason is that after they are created, I need to retreive them in order. The
simplest way to do this would be to sort them alphabetically, but that won't
work because if there were 10 or more slides, slide10 would sort before
slide2. It would be better if the program left-padded the numbers with zeros
but obviously it doesn't.

Also, the folder it creates is not named after the presentation, but after
the file name that is provided to the SaveAs function. So if I tell it to
use filename test.jpg, it actually creates a folder called test and puts the
jpg files there.

Glenn

-----------
 
K

Kathy J

Check out this PPT FAQ entry for a start:
Export slides as graphics
http://www.rdpslides.com/pptfaq/FAQ00022.htm

You will want to make one change to the code. On the .Export line, where it
says "Slide" you will want to change that to "Slide0". I believe that you
can format the number for the slide index, but don't know how to do it off
the top of my head. Maybe one of the true VBA gurus will comment with how to
do that part.
--
Kathryn Jacobs, Microsoft MVP PowerPoint and OneNote
Get PowerPoint answers at http://www.powerpointanswers.com
Cook anything outdoors with http://www.outdoorcook.com
Get OneNote answers at http://www.onenoteanswers.com

I believe life is meant to be lived. But:
if we live without making a difference, it makes no difference that we lived
 
G

Glenn Alcott

That FAQ entry was useful. I was using Save As but maybe I'll use Export
instead. It would be simple to format the slide index numbers just by
padding them with zeros so they're all the same length. That is not
guru-level coding!!

Glenn
 
S

Steve Rindsberg

Read up on the Slide.Export method in the VBA Help for PPT
By using .Export instead of SaveAs, you can have the files named anything you
like and control the resolution at the same time.


Glenn Alcott said:
I am writing a VB program to automate the saving of Powerpoint
presentations as JPG files. This is working fine, but I have a
question about the file names of the exported JPGs. They are being
named with the word "slide" followed by a sequential number, i.e.,
"slide1.jpg", "slide2.jpg", etc. What I want to know is whether this
file naming scheme is always used, or if there are any circumstances
where the JPG files would be named differently. I am doing some
further processing on these files which will be a lot easier if I know
what file names to expect.

Glenn

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
S

Steve Rindsberg

That FAQ entry was useful. I was using Save As but maybe I'll use Export
instead. It would be simple to format the slide index numbers just by
padding them with zeros so they're all the same length. That is not
guru-level coding!!

No, and VBA will do it for you. Off top of head:

BaseName & Format(cstr(.SlideIndex),"0000")

will give you the SlideIndex of the slide formatted to four places, left-padded
with zero.

In other words, if BaseName is "MySlide", you'd get:

MySlide0001 for slide 1
MySlide0203 for slide 203

and so on.

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
J

John Langhans [MSFT]

[CRITICAL UPDATE - Anyone using Office 2003 should install the critical
update as soon as possible. From PowerPoint, choose "Help -> Check for
Updates".]
[TOP ISSUE - Are you having difficulty opening presentations in PowerPoint
that you just created (you can save, but not open)? -
http://support.microsoft.com/?id=329820]

Hello,

If you (or anyone else reading this message) have suggestions for how to
make this easier to do in PowerPoint, don't forget to send your feedback
(in YOUR OWN WORDS, please) to Microsoft at:

http://register.microsoft.com/mswish/suggestion.asp

It's VERY important that, for EACH wish, you describe in detail, WHY it is
important TO YOU that your product suggestion be implemented. A good wish
submssion includes WHAT scenario, work-flow, or end-result is blocked by
not having a specific feature, HOW MUCH time and effort ($$$) is spent
working around a specific limitation of the current product, etc. Remember
that Microsoft receives THOUSANDS of product suggestions every day and we
read each one but, in any given product development cycle, there are ONLY
sufficient resources to address the ones that are MOST IMPORTANT to our
customers so take the extra time to state your case as CLEARLY and
COMPLETELY as possible so that we can FEEL YOUR PAIN.

IMPORTANT: Each submission should be a single suggestion (not a list of
suggestions).

John Langhans
Microsoft Corporation
Supportability Program Manager
Microsoft Office PowerPoint for Windows
Microsoft Office Picture Manager for Windows

For FAQ's, highlights and top issues, visit the Microsoft PowerPoint
support center at: http://support.microsoft.com/default.aspx?pr=ppt
Search the Microsoft Knowledge Base at:
http://support.microsoft.com/default.aspx?pr=kbhowto

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of any included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top