media Property

Microsoft FrontPage Visual Basic

media Property

Returns or sets a string that represents the type of media in which the content will be displayed. Corresponds to the media attribute for the STYLE and LINK elements.

expression.media

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

Remarks

The String value for the media property can be one of the following:

Value Description
screen Output is intended for computer screens.
print Output is intended for printed material and for documents on screen viewed in Print Preview mode.
all Applies to all devices.

Remarks

If the media property has no value, the style sheet applies to all views of the document.

Example

The following example specifies that the styles contained in the first STYLE element in the active document apply to when the page is printed or viewed in print preview mode.

    Dim objHead As IHTMLElement
Dim objStyle As FPHTMLStyleElement
    
Set objHead = ActiveDocument.all.tags("head").Item(0)
Set objStyle = objHead.all.tags("style").Item("printmedia")

objStyle.media = "print"