VBA - Copying footers

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

Hi,
I am copying slides by using code from:
http://skp.mvps.org/pptxp001.htm

However, the footers are not getting copied. So I am doing this additional processing:

'add Footer
If CBool(sldSource.HeadersFooters.Footer.Visible) Then
With sldInserted.HeadersFooters.Footer
.Visible = msoTrue
.Text = ppPresSource.Slides(mySlide.SlideIndex).HeadersFooters.Footer.Text
End With
End If

If CBool(sldSource.HeadersFooters.DateAndTime.Visible) Then
sldInserted.HeadersFooters.DateAndTime.Visible = msoTrue
If CBool(sldSource.HeadersFooters.DateAndTime.UseFormat) Then
sldInserted.HeadersFooters.DateAndTime.UseFormat = msoTrue
Else
sldInserted.HeadersFooters.DateAndTime.Text = ppPresSource.Slides(mySlide.SlideIndex).HeadersFooters.DateAndTime.Text
End If
End If

sldInserted.HeadersFooters.SlideNumber.Visible = sldSource.HeadersFooters.SlideNumber.Visible

Could anyone please confirm if this is correct? Is it really that we need to explicitly copy footers?

Regards,
Sam
 
Which version of PPT are you using?

Regards,
Shyam Pillai

Image Importer Wizard
http://skp.mvps.org/iiw.htm

Hi,
I am copying slides by using code from:
http://skp.mvps.org/pptxp001.htm

However, the footers are not getting copied. So I am doing this additional
processing:

'add Footer
If CBool(sldSource.HeadersFooters.Footer.Visible) Then
With sldInserted.HeadersFooters.Footer
.Visible = msoTrue
.Text =
ppPresSource.Slides(mySlide.SlideIndex).HeadersFooters.Footer.Text
End With
End If

If CBool(sldSource.HeadersFooters.DateAndTime.Visible) Then
sldInserted.HeadersFooters.DateAndTime.Visible = msoTrue
If CBool(sldSource.HeadersFooters.DateAndTime.UseFormat) Then
sldInserted.HeadersFooters.DateAndTime.UseFormat = msoTrue
Else
sldInserted.HeadersFooters.DateAndTime.Text =
ppPresSource.Slides(mySlide.SlideIndex).HeadersFooters.DateAndTime.Text
End If
End If

sldInserted.HeadersFooters.SlideNumber.Visible =
sldSource.HeadersFooters.SlideNumber.Visible

Could anyone please confirm if this is correct? Is it really that we need to
explicitly copy footers?

Regards,
Sam
 
Also the footers like datetime, slideno, footer are not getting copied when
I copy the slidemaster/titlemaster into another presentation. I guess, I
will need to copy them as well by using code like this:

sldinserted.Master.HeadersFooters.Footer.Visible=sldsource.Master.HeadersFooters.Footer.Visible
sldinserted.Master.HeadersFooters.Footer.Text=sldsource.Master.HeadersFooters.Footer.Text
sldinserted.Master.HeadersFooters.SlideNumber.Visible=sldsource.Master.HeadersFooters.SlideNumber.Visible
sldinserted.Master.HeadersFooters.DateAndTime.Visible=sldsource.Master.HeadersFooters.DateAndTime.Visible
sldinserted.Master.HeadersFooters.DateAndTime.Text=sldsource.Master.HeadersFooters.DateAndTime.Text

I think I will need to do this for slide master and the slide itself. Am I
correct?

How can I access the above info for "Notes and Handouts" tab that appears in
"Headers and Footers" dialog box thru' VBA?

Thanks,
Sam
 
Back
Top