WebPageOptions.BackgroundSound property (Publisher)

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

Syntax

expression.BackgroundSound

expression A variable that represents a WebPageOptions object.

Return value

String

Remarks

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

If BackgroundSound is specified, the background sound plays 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 that 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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.