Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Playing a sound file using VBScript

Posted on 2004-04-29
2
Medium Priority
?
497 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
[X]
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
  • 2
2 Comments
 
LVL 14

Accepted Solution

by:
aelatik earned 1800 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

721 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