Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Playing a sound file using VBScript

Posted on 2004-04-29
2
474 Views
Last Modified: 2007-12-19
Does anybody know if it is possible to play a sound file from a vb script?
0
Comment
Question by:NorCal2612
  • 2
2 Comments
 
LVL 14

Accepted Solution

by:
aelatik earned 450 total points
ID: 10950813
Dim WSH, SND
SND = "c:\windows\media\ding.wav"
Set       WSH = CreateObject("Wscript.Shell")
      WSH.Run "sndrec32 /play /close """ & SND & """",0,True
Set       WSH = Nothing
0
 
LVL 14

Expert Comment

by:aelatik
ID: 10950825
Otherwise you need to wrap an api into a dll wich you can call with VBSCRIPT
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question