Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need VBA Help with PowerPoint 2010

Posted on 2013-05-10
3
Medium Priority
?
649 Views
Last Modified: 2013-05-16
Hello,

I have 600 images, all around 500K - 1MB in size, that I need to import into a PowerPoint file one image per page.  I have figured out how to use Import Photo Album to get each image on a single slide with a blank title and a caption that is the file name.  What I am looking for is an automated way to copy the image captions (which are the file name) into each slide's Title.  This way, a user can look at the presentation outline and find the image(s) that they want.

In the past I would have used a Macro.  In PP 2010 they did away with macros in favor of VBA.  I know nothing about VBA.  I am hoping an expert would be able to provide me with the VBA code that will meet my needs.  I essentially want to run the macro and have it automatically go to each slide and copy the caption into the Title.

Please let me know if you have any questions!!
0
Comment
Question by:MrChip2
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
JSRWilson earned 2000 total points
ID: 39157656
vba and macros are the same thing. I guess you mean there is no longer a recorder. It wouldn't have recorded this anyway.

Try this:

Sub getTitle()
Dim osld As Slide
Dim oshp As Shape
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.Type = msoGroup And osld.Shapes.HasTitle Then
osld.Shapes.Title.TextFrame.TextRange = oshp.GroupItems(2).TextFrame.TextRange
oshp.GroupItems(2).Delete
End If
Next oshp
Next osld
End Sub

If you want the caption NOT deleted remove the line
oshp.GroupItems(2).Delete

How to use vba
0
 

Author Comment

by:MrChip2
ID: 39173312
OMG - AMAZING!!

This macro is 10,000% perfect.  Thank you so much!  I'm sorry it took so long to respond.  I would rate this an A+++ and award 1,000 points if I could.  Thanks!
0
 

Author Closing Comment

by:MrChip2
ID: 39173314
See my posted comment.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This video teaches viewers how to add transitions to their Slideshows and how to set up timing for the transitions.
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question