Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can I use a variable to do it ?

Status
Not open for further replies.

vincent120683

Programmer
Apr 9, 2003
10
0
0
FR
Hello,

My problem is:
Thanks to my VB program, I do catch some informationsabout all shapes on all slides of a PowerPoint presentation.

-To catch the name of the first shape on the first slide, I write:
myName = ActivePresentation.Slides(1).Shapes(1).Name
-To catch the name of the first shape on the SlideMaster, it's:
myName = ActivePresentation.SlideMaster.Shapes(1).Name

The only difference is: "SlideMaster" || "Slides(1)"

In order to optimize my program, I would like to put the beginning of these 'sentences' in a variable:
'On the SlideMaster:
var = ActivePresentation.SlideMaster
'On the other slides:
var = ActivePresentation.Slides

In the end, I want to have my program like this:
myName_shape1_slidemaster = var + .Shapes(1).Name
myName_shape1_slide1 = var + (1).Shapes(1).Name
"+" means what I need to add.

Any idea to help me?
Please give me a clear answer because I'm a young french programmer!
Thanks.
 
Look up the WITH keyword


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top