Solved

Need VBA Help with PowerPoint 2010

Posted on 2013-05-10
3
641 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Setting the Scene Animations in PowerPoint are a great tool to convey messages when used carefuly with the content of your slides. There are plenty of animation effects and options, including a Repeat feature for individual animation effects. …
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This video teaches viewers how to fit pictures into slides, crop and remove backgrounds, and alter photos to look more professional.
The viewer will learn how to edit the master slide. They will also learn how to combine multiple themes into one master slide to use them in their presentation.

821 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