Shared addin for powerpoint

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

Hopefully I have put this in the right forum!

I have created a shared addin using VS 2005, .net 2.0 in c# for MS
Powerpoint 2003.

The shared addin adds various meta data, text boxes to the presentation
slides but it also adds Headers and footers to the notes/handouts
pages/views.

presentation.notesviewmaster.headerfooters.footer = "SomeText"

I would like to format the text in these headers and footers to font 14,
bold, times new roman. I cannot seem to do this. Any ideas how I can
automate this in c#?

Best Regards,

Pablo
 
Hi All,

Hopefully I have put this in the right forum!

I have created a shared addin using VS 2005, .net 2.0 in c# for MS
Powerpoint 2003.

The shared addin adds various meta data, text boxes to the presentation
slides but it also adds Headers and footers to the notes/handouts
pages/views.

presentation.notesviewmaster.headerfooters.footer = "SomeText"

I would like to format the text in these headers and footers to font 14,
bold, times new roman. I cannot seem to do this. Any ideas how I can
automate this in c#?

No idea how to do it in c# but in any language, you'd have to get a reference
to the Header placeholder on the notes master and format it by setting its
properties.

VBA example:

Sub FormatNotesHeader()
Dim oSh As Shape
Set oSh = NotesMasterHeader()
If Not oSh Is Nothing Then
With oSh.TextFrame.TextRange
.Font.Name = "Arial"
.Font.Size = 12
End With
' Set any other shape, textframe, textrange properties
' you like
End If

End Sub

Function NotesMasterHeader() As Shape
' Return the presentation's Notes Master Header shap

Dim oSh As Shape

For Each oSh In ActivePresentation.NotesMaster.Shapes

' Is it a placeholder shape?
If oSh.Type = msoPlaceholder Then
' msoPlaceholder is a Long = 14

' Is the placeholder a header placeholder?
If oSh.PlaceholderFormat.Type = ppPlaceholderHeader Then
' msoPlaceholderHeader is also Long = 14
' it's the one we're after
Set NotesMasterHeader = oSh
Exit Function
End If

End If
Next

End Function
 
Back
Top