Table of contents
TOC
Collapse the table of content
Expand the table of content

WebPageOptions.SetBackgroundSoundRepeat Method (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

Specifies whether the background sound attached to a Web page should be played infinitely after the page is loaded in a Web browser, and if it should not, optionally specifies the number of times the background sound should be played.

Syntax

expression. SetBackgroundSoundRepeat( RepeatForever, RepeatTimes)

_expression_A variable that represents a WebPageOptions object.

Parameters

NameRequired/OptionalData TypeDescription
RepeatForeverRequiredBooleanSpecifies whether the background sound should be played infinitely. The value of this parameter is used to populate the value of the ** BackgroundSoundLoopForever Property** property.
RepeatTimesOptionalLongSpecifies how many times the background sound should be played. The value of this parameter is used to populate the value of the ** BackgroundSoundLoopCount Property** property.

Remarks

If the RepeatForever parameter is set to True, the optional RepeatTimes parameter cannot be specified. Attempting to specify RepeatTimes if RepeatForever is True results in a run-time error.

If the RepeatForever parameter is set to False, the optional RepeatTimes parameter must be specified. Omitting RepeatTimes if RepeatForever is False results in a run-time error.

Example

The following example sets the background sound for page four of the active Web publication to a .wav file on the local computer. If BackgroundSoundLoopForever is False, the SetBackgroundSoundRepeat method is used to specify that the background sound be repeated infinitely (note the omission of the RepeatTimes parameter). If BackgroundSoundLoopForever is True, the SetBackgroundSoundRepeat method is used to specify that the background sound not be repeated infinitely, but that it should be repeated twice.

Dim theWPO As WebPageOptions 

Set theWPO = ActiveDocument.Pages(4).WebPageOptions 

With theWPO 
 .BackgroundSound = "C:\CompanySounds\corporate_jingle.wav" 
 If .BackgroundSoundLoopForever = False Then 
 .SetBackgroundSoundRepeat RepeatForever:=True 
 ElseIf .BackgroundSoundLoopForever = True Then 
 .SetBackgroundSoundRepeat RepeatForever:=False, RepeatTimes:=2 
 End If 

End With
© 2018 Microsoft