vba code to insert filename in footer

M

mareenq

I have no idea how to write VBA code, and I can't find anything published to
create a macro that will update the filename in my PPT 07 footers.

I'd be very grateful for some help
thanks
 
M

Michael Koerner

Have a look here to see if this meets your needs.
http://support.microsoft.com/kb/222797

--
Michael Koerner
MS MVP - PowerPoint


I have no idea how to write VBA code, and I can't find anything published to
create a macro that will update the filename in my PPT 07 footers.

I'd be very grateful for some help
thanks
 
M

mareenq

Thanks but no cigar I'm afraid! I get a run time error and the debugger
highlights:
.Text = PathAndName
.... which explains not very much :-(
 
D

David Marcovitz

Unfortunately, I believe that code would not work for PPT2007. Slide
masters have changed.
--David
 
M

Michael Koerner

Arrrrrrrrrrrrgh your quite correct David, missed the 2007. ISTR that John
Wilson wrote a macro for just this purpose a while back. Unfortunately I
can't find it on his site.

--
Michael Koerner
MS MVP - PowerPoint


Unfortunately, I believe that code would not work for PPT2007. Slide
masters have changed.
--David
 
J

John Wilson

The code fails because most likely there is no footer visible on the slides
when you itterate through them

Make this change to the last bit ...

With ActivePresentation.Slides(X).HeadersFooters
With .Footer
..Visible=True 'Add this line
..Text = PathAndName
End With
End With

--

john ATSIGN PPTAlchemy.co.uk
Custom vba coding and PPT Makeovers
Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html
 
M

Michael Koerner

Thanks John

--
Michael Koerner
MS MVP - PowerPoint


"John Wilson" <john AT technologytrish.co DOT uk> wrote in message
The code fails because most likely there is no footer visible on the slides
when you itterate through them

Make this change to the last bit ...

With ActivePresentation.Slides(X).HeadersFooters
With .Footer
..Visible=True 'Add this line
..Text = PathAndName
End With
End With

--

john ATSIGN PPTAlchemy.co.uk
Custom vba coding and PPT Makeovers
Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html
 
S

Saravanan Mani

Even by using the below code it still getting debug message at .Text = PathAndName

Could someone help me out to get the code for displaying the filename and path at the footer by deafult in powerpoint.

Please.....
 
Joined
May 19, 2011
Messages
1
Reaction score
0
Here it is for Word, in case anyone is searching for it!

Sub InsertFilenameFooter()
With ActiveDocument.Sections(1)
.Footers(wdHeaderFooterPrimary).Range.Text = ActiveDocument.Path & Application.PathSeparator & ActiveDocument.Name​
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top