Page.ExportEmailHTML method (Publisher)

Exports the active page of the publication as an HTML file.

Syntax

expression.ExportEmailHTML (FileName)

expression A variable that represents a Page object.

Parameters

Name Required/Optional Data type Description
FileName Required String The name of the file to which to export the HTML.

Remarks

If the name of an existing HTML file is specified, that file is overwritten.

This method can only be used on the active page of the publication.

Example

The following example sets the first page in the document as the active page, and exports that page to a file. Note that PathToFile must be replaced with a valid file path for this example to work.

Sub ExportEmail() 
 Dim strFilePath As String 
 strFilePath = "PathToFile" 
 With ActiveDocument.ActiveView 
 .ActivePage = ActiveDocument.Pages(1) 
 .ActivePage.ExportEmailHTML (strFilePath) 
 End With 
 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.