Powerpoint 2007 en VBA

nathaly

New Member
Joined
May 4, 2009
Messages
10
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?

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
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Hi Nathaly,
I could understand what you were saying. Let me remind you that this place is for english only, there is a specific link on the main page where non speaking english person can post their thread.
 
Upvote 0

Forum statistics

Threads
1,223,964
Messages
6,175,657
Members
452,664
Latest member
alpserbetli

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top