Macro for Power Point

J

John777

Hi,
I have a request to create a macro and also to add a custom toolbar/button
for it.
The macro suppose to insert a file name and path when run. I know how to do
this in word and excel, but was not able to figure out in power point.
Is anyone know how I could accomplish this?
 
E

Echo S

http://support.microsoft.com/kb/222797/en-us for the code.

Then see
http://pptfaq.com/index.html#name_Creating_and_Installing_Add-ins-_Toolbars-_Buttons
to create an add-in so the macro will be available on a toolbar button.

--
Echo [MS PPT MVP] http://www.echosvoice.com
What's new in PowerPoint 2007? http://www.echosvoice.com/2007.htm
(New!) The PowerPoint 2007 Complete Makeover Kit http://tinyurl.com/2qzlpl
Fixing PowerPoint Annoyances
http://www.oreilly.com/catalog/powerpointannoy/index.html
 
S

Steve Rindsberg

Hi,
I have a request to create a macro and also to add a custom toolbar/button
for it.
The macro suppose to insert a file name and path when run. I know how to do
this in word and excel, but was not able to figure out in power point.
Is anyone know how I could accomplish this?

Which part are you having trouble with?

This will add a text shape:

Sub SimpleVersion()

Dim oSh As Shape
' watch the linebreaks:
Set oSh =
ActiveWindow.Selection.SlideRange.Shapes.AddTextbox(msoTextOrientationHorizonta
l, 30, 510, 510, 28.875)

' format the text:
With oSh.TextFrame.TextRange
.Text = "Filename and Path"
With .Font
.NameAscii = "Arial"
.Size = 18
End With
End With

End Sub

The PowerPoint FAQ pages here explain how to create add-ins, toolbars etc:

Creating and Installing Add-ins, Toolbars, Buttons
http://www.pptfaq.com/index.html#name_Creating_and_Installing_Add-ins-_Toolbars
-_Buttons
 
J

John777

Thanks for your response Echo... this is great info here, I will post my
results back after I am done with my task.
--
Thanks


Echo S said:
http://support.microsoft.com/kb/222797/en-us for the code.

Then see
http://pptfaq.com/index.html#name_Creating_and_Installing_Add-ins-_Toolbars-_Buttons
to create an add-in so the macro will be available on a toolbar button.

--
Echo [MS PPT MVP] http://www.echosvoice.com
What's new in PowerPoint 2007? http://www.echosvoice.com/2007.htm
(New!) The PowerPoint 2007 Complete Makeover Kit http://tinyurl.com/2qzlpl
Fixing PowerPoint Annoyances
http://www.oreilly.com/catalog/powerpointannoy/index.html

John777 said:
Hi,
I have a request to create a macro and also to add a custom toolbar/button
for it.
The macro suppose to insert a file name and path when run. I know how to
do
this in word and excel, but was not able to figure out in power point.
Is anyone know how I could accomplish this?
 
J

John777

--
Thanks


Echo S said:
http://support.microsoft.com/kb/222797/en-us for the code.

Then see
http://pptfaq.com/index.html#name_Creating_and_Installing_Add-ins-_Toolbars-_Buttons
to create an add-in so the macro will be available on a toolbar button.

--
Echo [MS PPT MVP] http://www.echosvoice.com
What's new in PowerPoint 2007? http://www.echosvoice.com/2007.htm
(New!) The PowerPoint 2007 Complete Makeover Kit http://tinyurl.com/2qzlpl
Fixing PowerPoint Annoyances
http://www.oreilly.com/catalog/powerpointannoy/index.html

John777 said:
Hi,
I have a request to create a macro and also to add a custom toolbar/button
for it.
The macro suppose to insert a file name and path when run. I know how to
do
this in word and excel, but was not able to figure out in power point.
Is anyone know how I could accomplish this?

I followed the procedure and code works perfectly, just one little thing I
need to fix. Now when I run macro it inserts File name and path on multiple
lines, because files are usually stored three levels down the hierarchy. So,
it is not showing the last row on the slide which is file name, same thing
happens if I print it as well. I was trying to see within that script if
there is a way to put everything on one line instead.
Any help is appreciated...
 
E

Echo S

I followed the procedure and code works perfectly, just one little thing I
need to fix. Now when I run macro it inserts File name and path on
multiple
lines, because files are usually stored three levels down the hierarchy.
So,
it is not showing the last row on the slide which is file name, same thing
happens if I print it as well. I was trying to see within that script if
there is a way to put everything on one line instead.
Any help is appreciated...

I don't know. You might post in the PowerPoint newsgroup, where someone will
know.

Otherwise, you can increase the size of the box on the slide master. Go to
View | Master | Slide Master and change the footer box by dragging one of
the edges.

--
Echo [MS PPT MVP] http://www.echosvoice.com
What's new in PowerPoint 2007? http://www.echosvoice.com/2007.htm
(New!) The PowerPoint 2007 Complete Makeover Kit http://tinyurl.com/2qzlpl
Fixing PowerPoint Annoyances
http://www.oreilly.com/catalog/powerpointannoy/index.html
 
J

John777

Thanks Echo S, it worked with manually adjusting footer size, so it will do
it for now, until I find how to make it happen via vb script.
--
Thanks


Echo S said:
I followed the procedure and code works perfectly, just one little thing I
need to fix. Now when I run macro it inserts File name and path on
multiple
lines, because files are usually stored three levels down the hierarchy.
So,
it is not showing the last row on the slide which is file name, same thing
happens if I print it as well. I was trying to see within that script if
there is a way to put everything on one line instead.
Any help is appreciated...

I don't know. You might post in the PowerPoint newsgroup, where someone will
know.

Otherwise, you can increase the size of the box on the slide master. Go to
View | Master | Slide Master and change the footer box by dragging one of
the edges.

--
Echo [MS PPT MVP] http://www.echosvoice.com
What's new in PowerPoint 2007? http://www.echosvoice.com/2007.htm
(New!) The PowerPoint 2007 Complete Makeover Kit http://tinyurl.com/2qzlpl
Fixing PowerPoint Annoyances
http://www.oreilly.com/catalog/powerpointannoy/index.html
 
Top