backgroundPositionY Property

Microsoft FrontPage Visual Basic

backgroundPositionY Property

Returns or sets a String that represents the vertical position of the background image.

expression.backgroundPositionY

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

Remarks

The String value of the backgroundPositionY property can be one of the following:

length Floating-point number, followed by an absolute units designator (cm, mm, in, pt, pc, or px) or a relative units designator (em or ex).

The following code sets the backgroundPositionY property 10px, which positions the top edge of the background image 10 pixels from the top edge of the page.

ActiveDocument.body.Style.backgroundPositionY = "10px"

percentage Integer, followed by a %. The value is a percentage of the width or height of the object.

For example, the following code sets the top edge of the background image to 25 percent of the height of the page.

ActiveDocument.body.Style.backgroundPositionY = "10% 25%"

vAlignment Vertical alignment value consisting of one of the following:
top Vertical alignment is at the top.
center Vertical alignment is centered.
bottom Vertical alignment is at the bottom.

Use the backgroundPositionX property to set the horizontal position of the background image. You can use the backgroundPosition property to set the horizontal and vertical position of the background image. The following code shows what the example below would look like if you were using the backgroundPosition property to set the horizontal and vertical positions.

    ActiveDocument.body.Style.backgroundPosition = "center top"
  

Example

The following example sets the position of the background image for the active document. This example assumes you have a background image set for the active document.

    With ActiveDocument.body.Style
    .backgroundPositionX = "center"
    .backgroundPositionY = "top"
End With