|
This is just a short novelty
Microsoft Word Help and Tips Page
to show you how you can use an API (Application Programming Interface) to
play a sound byte when a Word document is opened. |
| Copy the following code to
project module of the document: |
Option Explicit
Private Declare Sub PlaySound Lib "winmm.dll" _
(ByVal lpszName As String, _
ByVal hModule As Long, _
ByVal dwFlags As Long)
Private Const SOUND_FILENAME = &H20000
Sub AutoOpen()
Dim sndFileName As String
'Note: Change the next line to point to
your sound file.
sndFileName = "C:\Sound 1.wav"
PlaySound sndFileName, 0&, SOUND_FILENAME
End Sub |
| See:
Installing Macros for instructions on how to set up and use the macros
listed above. |
|
|
Looking for something else? |
|
|
|
|