Microsoft KB Archive/100047: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 23: Line 23:
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.
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.
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 ==
== MORE INFORMATION ==
Line 31: Line 31:
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).
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).


<pre>Declare Function SndPlaySound Lib &quot;MMSYSTEM&quot;(File$, sFlag as Integer)\</pre>
<pre>Declare Function SndPlaySound Lib "MMSYSTEM"(File$, sFlag as Integer)\</pre>
as Integer
as Integer
<pre>Sub Main</pre>
<pre>Sub Main</pre>
x = SndPlaySound(&quot;c:\windows\jets.wav&quot;, 1) Super EditPaste
x = SndPlaySound("c:\windows\jets.wav", 1) Super EditPaste
<pre>End Sub
<pre>End Sub
</pre>
</pre>
Line 41: Line 41:
</pre>
</pre>
Reference(s):
Reference(s):
&quot;User's Guide,&quot; version 2.0, pages 784-786
"User's Guide," version 2.0, pages 784-786
|}
|}


Line 56: Line 56:
</span><br />
</span><br />
<br />
<br />
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.</blockquote>
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.</blockquote>
|}
|}


Last reviewed: July 30, 1997<br />
Last reviewed: July 30, 1997<br />
© 1998 Microsoft Corporation. All rights reserved. [[../cpyright|Terms of Use.]]<br />
© 1998 Microsoft Corporation. All rights reserved. [[../cpyright|Terms of Use.]]<br />

Latest revision as of 11:53, 19 July 2020



How to Assign Sounds to Word for Windows Commands

Last reviewed: July 30, 1997
Article ID: Q100047



The information in this article applies to:

  • 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



KBCategory: kbmacro kbhowto

KBSubcategory:
Additional query words: marketing 2.0 2.0a 2.0a-CD winword2
2.0b 2.0c winword
Version : 2.0 2.0a 2.0a-CD 2.0b 2.0c


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.