Publishing a Web Presentation

Microsoft PowerPoint Visual Basic

Publishing a Web Presentation

In Microsoft PowerPoint, you can publish a presentation directly to a Web server and you can edit HTML documents directly in PowerPoint.

Saving a Presentation as a Web Page

Saving a presentation as a Web page is the process of creating and saving an HTML version of a presentation. To do this, use the SaveAs method, as shown in the following example which saves the current presentation as c:\myfile.htm.

ActivePresentation.SaveAs "c:\myfile.htm", ppSaveAsHTMLv3, msoTrue
		

Publishing a Web Presentation

Publishing a Web presentation is the process of creating an HTML version of a presentation and saving it to a Web server or a file server using the Publish method. This differs from saving a presentation as a Web page using the SaveAs method in that when you publish a Web presentation, you can customize the presentation by setting various attributes, and you can publish the presentation directly to a Web server. After setting various properties of the WebOptions object, this example publishes the active presentation to a Web server with the URL address http://www.someones.homepage/mallard.htm.

With ActivePresentation
    With .WebOptions
        .FrameColors = ppFrameColorsWhiteTextOnBlack
        .RelyonVML = True
        .OrganizeInFolder = True
    End With
    With .PublishObjects(1)
        .FileName = "http://www.someones.homepage/mallard.htm"
        .SourceType = ppPublishAll
        .SpeakerNotes = True
        .Publish
    End With
End With
		

Web Options and Default Web Options

When using the Publish method, you can customize the appearance, content, browser support, editing support, graphics formats, screen resolution, file organization, and encoding of the HTML document by setting properties of the DefaultWebOptions object and the WebOptions object. The DefaultWebOptions object contains application-level properties. These settings are overridden by any presentation-level property settings that have the same name, contained in the WebOptions object.

This example sets various application-level properties for Web publishing. They will be the default settings for any current or future loaded presentation until the settings are changed again. The code then resets the ResizeGraphics property for the active presentation, which overrides the application-level default. It publishes the active presentation as "c:\mallard.htm."

With Application.DefaultWebOptions
    .FrameColors = ppFrameColorsWhiteTextOnBlack
    .IncludeNavigation = False
    .ResizeGraphics = True
End With
With ActivePresentation
    .WebOptions.ResizeGraphics = False
    With .PublishObjects(1)
        .FileName = "c:\mallard.htm"
        .SourceType = ppPublishAll
        .SpeakerNotes = True
        .Publish
    End With
End With
		

Opening an HTML document in PowerPoint

To edit an HTML document in PowerPoint, open the HTML document using the Open method. This example opens the file "myfile.htm" for editing.

Presentations.Open Filename:="c:\Windows\myfile.htm"