PreviewDocument Property
Returns an IHTMLDocument2 object that represents the document in the preview mode of the Page view.
expression.PreviewDocument
expression Required. An expression that returns a PageWindowEx object.
Remarks
The PreviewDocument property returns nothing if the active page window is not currently in preview mode.
Example
The following example displays the title of the document currently in preview mode. If there is no document in preview mode, a message is displayed to the user.
Sub PreviewDocument()
'Displays the title of the document currently in preview mode
Dim FPApp As FrontPage.Application
Dim objPageWindow As PageWindowEx
Set FPApp = FrontPage.Application
Set objPageWindow = FPApp.ActivePageWindow
'If the page window is in preview mode, display the title
If objPageWindow.ViewMode = fpPageViewPreview Then
MsgBox "The title of the document is: " _
& objPageWindow.PreviewDocument.Title
Else
MsgBox "The page window is not in preview mode."
End If
End Sub