Beste,
Ik had online een code gevonden om automatisch de bestandsnaam en het pad in de voettekst te plaatsen. Maar er zit een foutje in de code. Kan iemand daarmee helpen?
Alvast heel hartelijk bedankt,
Nathalyhttp://office.microsoft.com/en-gb/help/HA101730521033.aspx
Ik had online een code gevonden om automatisch de bestandsnaam en het pad in de voettekst te plaatsen. Maar er zit een foutje in de code. Kan iemand daarmee helpen?
Code:
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
Alvast heel hartelijk bedankt,
Nathalyhttp://office.microsoft.com/en-gb/help/HA101730521033.aspx