Solved

Need VBA Help with PowerPoint 2010

Posted on 2013-05-10
3
635 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 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
See my posted comment.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
This video teaches viewers how to add simple and professional themes to their slides.
This video teaches viewers how to add transitions to their Slideshows and how to set up timing for the transitions.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now