Global Macros? Relative References?

  • Thread starter Thread starter LizW
  • Start date Start date
L

LizW

Hi there,

Two Questions:

1. I can record macros for one presentation, and put them
on a toolbar for the user. After I close PowerPoint, the
toolbar is still there, but the buttons don't work and
when I look in Tools, Macros, they don't show. How to make
this macro work across all presentations?

2. If I record a macro and use an object that I want to
copy and paste, it calls the object in the VB something
like "Picture 23". So I can't use the macro in the future
with another object because it is looking for Picture 23.
Can I edit this reference to a specific object name given
by PowerPoint to make a relative not absolute reference?

Thanks
 
1. When you record a macro, it is stored in the presentation. If you want a
macro to be available to all presentations on your machine, you need an
add-in. You can find more information here:

http://www.rdpslides.com/pptfaq/FAQ00031.htm

2. Usually, macros that run in Normal View reference the selected object,
rather than a specific object. If you post the code for your macro, someone
might be able to offer specific suggestions, but the general idea is to
access a selected shape with

ActiveWindow.Selection.ShapeRange

If you use this format, it will not need the shape name or number. Instead
it will work on whatever shape is selected.

--David

David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
1. I can record macros for one presentation, and put them
on a toolbar for the user. After I close PowerPoint, the
toolbar is still there, but the buttons don't work and
when I look in Tools, Macros, they don't show. How to make
this macro work across all presentations?

You need to create and install an addin to make this work.

Create an ADD-IN with TOOLBARS that run macros
http://www.rdpslides.com/pptfaq/FAQ00031.htm
2. If I record a macro and use an object that I want to
copy and paste, it calls the object in the VB something
like "Picture 23". So I can't use the macro in the future
with another object because it is looking for Picture 23.
Can I edit this reference to a specific object name given
by PowerPoint to make a relative not absolute reference?

If I understand you right, you want to be able to do something later with the
shape created by the copy, is that correct?

' This will duplicate the selected shape and name the duplicate MyNewShape
ActiveWindow.Selection.ShapeRange.Duplicate.Name = "MyNewShape"

Later you can manipulate the shape like so

' Assuming X is the number of the slide your shape is on:
With ActivePresentation.Slides(x).Shapes("MyNewShape")
.Height = 1234
.Top = 112
' etc
End With

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
Back
Top