Microsoft KB Archive/100047

-

{| The information in this article applies to:
 * width="100%"|
 * Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c
 * Microsoft Windows operating system version 3.1

SUMMARY
If 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 INFORMATION
To 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 Main x = SndPlaySound("c:\windows\jets.wav", 1) Super EditPaste End Sub For 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 winword Reference(s): "User's Guide," version 2.0, pages 784-786
 * }

-

Last reviewed: July 30, 1997

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.