Macro to udpate and dislpay file path before save?

  • Thread starter Thread starter Nick Rumbelow
  • Start date Start date
N

Nick Rumbelow

Hi,

I've very new to macros, and really need some help. Does anyone know how to
make this macro (from Microsoft's knowlegde base) run automatically before
the presentation is saved?

Sub UpdatePath()

' Macro to add the path and file name to each slide's footer.
Dim PathAndName As String
Dim FeedBack As Integer

' Place a message box warning prior to replacing footers.
FeedBack = MsgBox( _
"This Macro replaces any existing text that appears " & _
"within your current footers " & Chr(13) & _
"with the presentation name and its path. " & _
"Do you want to continue?", vbQuestion + vbYesNo, _
"Warning!")

' If no is selected in the dialog box, quit the macro.
If FeedBack = vbNo Then
End
End If

' Gets the path and file name and converts the string to lowercase.
PathAndName = LCase(ActivePresentation.Path & "\" & _
ActivePresentation.Name)

' Checks whether there is a Title Master, and if so, updates the
' path.
If ActivePresentation.HasTitleMaster Then
With ActivePresentation.TitleMaster.HeadersFooters
With .Footer
.Text = PathAndName
End With
End With
End If

' Updates the slide master.
With ActivePresentation.SlideMaster.HeadersFooters
With .Footer
.Text = PathAndName
End With
End With

' Updates the individual slides that do not follow the master.
Dim X As Integer
For X = 1 To ActivePresentation.Slides.Count
With ActivePresentation.Slides(X).HeadersFooters
With .Footer
.Text = PathAndName
End With
End With
Next

End Sub


Any help would be greatly appreciated.

Nick
 
Thanks Steve, it is 2003 so I'll check that out and let you know. I
appreciate your help.

Nick
 
Hi, I tried following the link but I just don't know enough to be able to
understand it at all, kind of made my head go fuzzy...

I'm guessing it's not going to be simple?

Nick
 
Back
Top