How to Assign Sounds to Word for Windows CommandsLast reviewed: July 30, 1997Article ID: Q100047 |
The information in this article applies to:
SUMMARYIf your machine is capable of playing sounds, you can assign sounds to a Word for Windows command by modifying the macro for that command. WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
MORE INFORMATIONTo assign a .WAV sound file to a Word command, add the Windows API SndPlaySound function call and the name of the .WAV file to the macro for that command. When you execute the command, Word plays the .WAV file. For example, change the EditPaste command as shown below to assign the JETS.WAV sound file to that command. This sample macro assumes that the JETS.WAV sound file is located in the Windows program directory (which is on drive C and is called WINDOWS).
Declare Function SndPlaySound Lib "MMSYSTEM"(File$, sFlag as Integer)\as Integer
Sub Mainx = SndPlaySound("c:\windows\jets.wav", 1) Super EditPaste End SubFor more information on playing .WAV sound files from Word, query on the following words in the Microsoft Knowledge Base:
WAV and play and sound and winwordReference(s): "User's Guide," version 2.0, pages 784-786
|
KBCategory: kbmacro kbhowto
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |