Hi,
I wrote a code to update header and footers for all the slides of a particular powerpoint file (I have huge number of power point files having various slides to update) but seems I have gone somewhere wrong because of which its not happening. Requesting if anybody can help me. Below is the code.
Dim PowerPoint As PowerPoint.Application
Dim ppt As PowerPoint.Presentation
Dim PowerPointSelection As PowerPoint.Selection
Dim strpptPath As String
Dim fDialog As FileDialog
' Set up the File Dialog. '
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
Dim varFile As Variant
With fDialog
.AllowMultiSelect = True
.Title = "Select File Location to Export pptx :"
.InitialFileName = ""
If .Show = True Then
For Each varFile In .SelectedItems
GetFileName = varFile
strpptPath = GetFileName
Set PowerPoint = CreateObject("PowerPoint.Application")
PowerPoint.Visible = True
PowerPoint.Presentations.Open (strpptPath)
With PowerPoint
FooterText = .ActivePresentation.FullName
.ActivePresentation.Slides.Range.HeadersFooters.Foo ter.Visible = True
.ActivePresentation.Slides.Range.HeadersFooters.Foo ter.Text = "ABC"
End With
PowerPoint.ActivePresentation.Save
PowerPoint.ActivePresentation.Close
PowerPoint.Quit
Set PowerPoint = Nothing
Set ppt = Nothing
Set PowerPointSelection = Nothing
Next
End If
End With
Set PowerPoint = Nothing
Set ppt = Nothing
MsgBox "Updated Successfully"
Thank you,
Rakesh
I wrote a code to update header and footers for all the slides of a particular powerpoint file (I have huge number of power point files having various slides to update) but seems I have gone somewhere wrong because of which its not happening. Requesting if anybody can help me. Below is the code.
Dim PowerPoint As PowerPoint.Application
Dim ppt As PowerPoint.Presentation
Dim PowerPointSelection As PowerPoint.Selection
Dim strpptPath As String
Dim fDialog As FileDialog
' Set up the File Dialog. '
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
Dim varFile As Variant
With fDialog
.AllowMultiSelect = True
.Title = "Select File Location to Export pptx :"
.InitialFileName = ""
If .Show = True Then
For Each varFile In .SelectedItems
GetFileName = varFile
strpptPath = GetFileName
Set PowerPoint = CreateObject("PowerPoint.Application")
PowerPoint.Visible = True
PowerPoint.Presentations.Open (strpptPath)
With PowerPoint
FooterText = .ActivePresentation.FullName
.ActivePresentation.Slides.Range.HeadersFooters.Foo ter.Visible = True
.ActivePresentation.Slides.Range.HeadersFooters.Foo ter.Text = "ABC"
End With
PowerPoint.ActivePresentation.Save
PowerPoint.ActivePresentation.Close
PowerPoint.Quit
Set PowerPoint = Nothing
Set ppt = Nothing
Set PowerPointSelection = Nothing
Next
End If
End With
Set PowerPoint = Nothing
Set ppt = Nothing
MsgBox "Updated Successfully"
Thank you,
Rakesh