Solved

Need VBA Help with PowerPoint 2010

Posted on 2013-05-10
3
647 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
JSRWilson earned 500 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

Industry Leaders: 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

Setting the Scene PowerPoint is a creative tool in the right hands but it also includes a much underutilised programming dimension. In this beginner level article, we're going to show you some of some key elements of programming PowerPoint using th…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This video teaches viewers how to create handouts from their slides and helps them decide how many slides to include per handout.

631 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