I used a VBA project that I found on
http://www.rdpslides.com/ and
things work fine with the file till it gets to sub button 1 () - in
line 9 - END IF I get compile error that states End If without Block
if
Any ideas on how to fix that?
Sub Auto_Open()
Dim oToolbar As CommandBar
Dim oButton As CommandBarButton
Dim MyToolbar As String
' Give the toolbar a name
MyToolbar = "Kewl Tools"
' First, delete the toolbar if it already exists
On Error Resume Next ' so that it doesn't stop on the next line
if
the toolbar's already there
' Build the command bar
Set oToolbar = CommandBars.Add(Name:=MyToolbar,
Position:=msoBarFloating, Temporary:=True)
If Err.Number <> 0 Then ' Probably means the toolbar's already
there,
so we have nothing to do
Exit Sub
End If
On Error GoTo ErrorHandler
' Now add a button to the new toolbar
Set oButton = oToolbar.Controls.Add(Type:=msoControlButton)
' And set some of the button's properties
With oButton
.DescriptionText = "This is my first button" 'Tooltip text
when
mouse if placed over button
.Caption = "Button1" 'Text if Text in Icon is chosen
.OnAction = "Button1" 'Runs the Sub Button1() code when
clicked .Style = msoButtonIcon ' Button displays as icon,
not text or both .FaceId = 52 '52 is my favorite pig;
chooses icon #52 from
the available Office icons
End With
' Repeat the above for as many more buttons as you need to add
' Be sure to change the .OnAction property at least for each new
button
' You can set the toolbar position and visibility here if you like
' By default, it'll be visible when created
oToolbar.Top = 150
oToolbar.Left = 150
oToolbar.Visible = True
NormalExit:
Exit Sub ' so it doesn't go on to run the errorhandler code
ErrorHandler:
'Just in case there is an error
MsgBox Err.Number & vbCrLf & Err.Description
Resume NormalExit:
End Sub
Sub Button1()
Dim oSlides As Slides
Dim oSl As Slide
Dim oSh As Shape
Set oSlides = ActivePresentation.Slides
For Each oSl In oSlides
For Each oSh In oSl.NotesPage.Shapes
If oSh.PlaceholderFormat.Type = ppPlaceholderBody Then oSh.Delete
End If
Next oSh
Next oSl
End Sub
Echo S said:
Yeah, that "do not include notes" option in the save as web page
doesn't actually strip out the notes (as you're finding out) -- what
it does is just not show them in the web view. But the notes are
indeed still there if someone opens the file in PPT.
If you need to strip the notes before publishing to the web, check
this FAQ entry: Delete notes page text (or text and shapes)
http://www.rdpslides.com/pptfaq/FAQ00178.htm
--
Echo [MS PPT MVP]
http://www.echosvoice.com
HJC said:
Actually, I go to SAVE AS Web page and then go to PUBLISH and
uncheck display
speaker notes - the file is then saved as an MHT file - when it is
viewed on
the web, cannot seem to see notes, but if someone downloads it and
opens it
in PP all the notes are there.
:
HJC,
When you save the ppt as a webpage..... you upload all the html
files powerpoint produces...then the speaker notes should not be
visible.
Are you also uploading your ppt file, and that is what people are
downloading? If so, then you speaker notes will still be
included.
Cheers
TAJ Simmons
microsoft powerpoint mvp
awesome - powerpoint backgrounds,
free powerpoint templates, tutorials, hints and tips etc
http://www.powerpointbackgrounds.com
When I save a PP as a web page, I select the option NOT to
include the speaker's notes yet they still seem to be contained
when someone downloads
the file and opens it in PP. Any suggestions would be
appreciated.