SaveAs Method

       

Saves the specified publication with a new name or format.

expression.SaveAs(FileName, Format, AddToRecentFiles)

expression   Required. An expression that returns one of the objects in the Applies To list.

FileName  Optional Variant. The name for the publication. The default is the current folder and file name. If the publication has never been saved, the default name is used (for example, Publication1.pub). If a publication with the specified file name already exists, the publication is overwritten without the user being prompted first.

Format  Optional PbFileFormat. The format in which the publication is saved.

PbFileFormat can be one of these PbFileFormat constants.
pbFilePublication default
pbFilePublicationHTML
pbFilePublisher2000
pbFilePublisher98
pbFileRTF
pbFileWebArchive

AddToRecentFiles  Optional Boolean. True to add the publication to the list of recently used files on the File menu. Default is True.

Remarks

If there is insufficient memory or disk space to save the file, an error occurs.

Calling the SaveAs method always performs saves in the foreground regardless of whether background saves are enabled.

Example

This example saves the active publication as a Microsoft Publisher 2000 file.

ActiveDocument.SaveAs _
    FileName:="ReportPub2000.pub", Format:=pbFilePublisher2000

This example saves the active publication as Test.rtf in Rich Text Format (RTF).

ActiveDocument.SaveAs _
    FileName:="Test.rtf", Format:=pbFileRTF