Total Visual SourceBook

Total Visual SourceBook CD and Printed Manual

Microsoft Access/ Office 2016, 2013, 2010, and 2007 Version
is Shipping!

New features in Total Visual SourceBook for Access, Office 2007 and VB6

Supports Access/Office 2016, 2013, 2010 and 2007, and Visual Basic 6.0!

Separate version for Access/Office 2003, 2002, and 2000.

Separate version for:
Access 97/95


View all FMS products for Microsoft AccessAll Our Microsoft Access Products

SourceBook Info:

Why SourceBook?

 

"The code is exactly how I would like to write code and the algorithms used are very efficient and well-documented."

Van T. Dinh, Microsoft MVP

 

 

 

Microsoft Access, Office/VBA, VB6 Modules royalty-free source code libraryMicrosoft Access Modules royalty-free source code libraryMicrosoft Access VBA and VB6 Module Library Free trial of Total Visual SourceBook for Microsoft Access, Office, VB6 and VBA

Module: WindowsMediaPlayer in Category ActiveX Controls : Multimedia from Total Visual SourceBook

Routines for working with the Windows Media Player control in VBA and VB6.

Procedure List

Procedure Name

Type

Description

(Declarations) Declarations Declarations and private variables for the modWindowsMediaPlayer module
WMPControlLoad Procedure Plays a media file in the specified Windows Media Player control.
WMPControlPlay Procedure Plays the file loaded in the Windows Media Player control.
WMPControlPause Procedure Pauses or resumes the file playing in the Windows Media Player control.
WMPControlStop Procedure Stops the file playing in the Windows Media Player control.
WMPControlVolume Procedure Adjusts the volume in a Windows Media Player control.
WMPControlMute Procedure Turns off the volume to mute the Windows Media Player control.
LaunchWMP Procedure Launches the specified file in Windows Media Player.

Example Code for Using Module: WindowsMediaPlayer

' Example of modWindowsMediaPlayer
'
' To try this example, do the following:
' 1. Create a new form
' 2. Add the following command buttons
'       Command0
'       Command1
'       Command2
'       Command3
'       Command4
'       Command5
'       Command6
'       Command7
' 3. Add a text box named txtPath
' 4. Add a Windows Media Player control named wmpTest
' 5. Paste this code into the form's module

' Constant for the default multimedia file. Others include C:\Total Visual SourceBook 2013\Samples\test.wav, C:\Users\Public\Music\Sample Music\*.wma, etc.
Const mcstrSamp As String = "C:\Total Visual SourceBook 2013\Samples\test.avi"

Private Sub Command0_Click()
  ' Load
  If Nz(Me.txtPath, "") = "" Then
    MsgBox "Please specify a file to play."
    Me.txtPath = mcstrSamp
    Me.txtPath.SetFocus
  Else
    WMPControlLoad Me.wmpTest.Object, Me.txtPath
  End If
End Sub

Private Sub Command1_Click()
  ' Play
  WMPControlPlay Me.wmpTest.Object
End Sub

Private Sub Command2_Click()
  'Pause
  WMPControlPause Me.wmpTest.Object
End Sub

Private Sub Command3_Click()
  ' Stop
  WMPControlStop Me.wmpTest.Object
End Sub

Private Sub Command4_Click()
  ' Increase Volume
  WMPControlVolume Me.wmpTest.Object, False, 10
End Sub

Private Sub Command5_Click()
  ' Decrease Volume
  WMPControlVolume Me.wmpTest.Object, True, 10
End Sub

Private Sub Command6_Click()
  ' Mute
  WMPControlMute Me.wmpTest.Object
End Sub

Private Sub Command7_Click()
  ' Launch WMP
  If Nz(Me.txtPath, "") = "" Then
    MsgBox "Please specify a file to play."
    Me.txtPath = mcstrSamp
    Me.txtPath.SetFocus
  Else
    LaunchWMP (Me.txtPath)
  End If
End Sub

Private Sub Form_Load()
  ' Setup controls
  Me.Command0.Caption = "Load"
  Me.Command1.Caption = "Play"
  Me.Command2.Caption = "Pause"
  Me.Command3.Caption = "Stop"
  Me.Command4.Caption = "Vol +"
  Me.Command5.Caption = "Vol -"
  Me.Command6.Caption = "Mute"
  Me.Command7.Caption = "Launch WMP"
  Me.txtPath = mcstrSamp
End Sub

Microsoft Access Module LibraryOverview of Total Visual SourceBook

The source code in Total Visual SourceBook includes modules and classes for Microsoft Access, Visual Basic 6 (VB6), and Visual Basic for Applications (VBA) developers. Easily add this professionally written, tested, and documented royalty-free code into your applications to simplify your application development efforts.

Additional Resources