Beste,
Ik heb online een vbacode gevonden om automatisch de filename en het pad in te geven in de voettekst van elke slide.
Maar er zit een foutje in de code. Kan iemand mij helpen?
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
[color=red] .Text = PathAndName[/color]
End With
End With
Next
End Sub
Het rode is fout. Alvast bedankt
Nathaly