BackgroundSound Property

Microsoft Publisher Visual Basic

BackgroundSound Property

Returns or sets a String that specifies the path to a sound file that is played when the Web page is loaded in a Web browser. Read/write.

expression.BackgroundSound

expression    Required. An expression that returns a WebPageOptions object.

Remarks

The path to the background sound file must be a network path or a local path; an http:// address will not work.

If BackgroundSound is specified, the background sound will play once by default. The SetBackgroundSoundRepeat method can be used to specify whether the background sound should be played infinitely, and if it should not, to specify the number of times the background sound file should be played.

The background sound can be any of the following file types.

*.wav
*.mid
*.midi
*.rmi
*.au
*.aif
*.aiff

Example

The following example sets the background sound for page four of the active Web publication to a .wav file on the local computer. This .wav file will play once when the page is loaded in a Web browser.

Dim theWPO As WebPageOptions

Set theWPO = ActiveDocument.Pages(4).WebPageOptions

With theWPO
    .BackgroundSound = "C:\CompanySounds\corporate_jingle.wav"
End With