Solved

Can I play an audio file with VBA running a Word 2010 document

Posted on 2011-02-18
3
542 Views
Last Modified: 2012-05-11
Is there a relatively easy way when running VBA in Word (2010 or earlier) to get the computer to play a short sound file?

If so, How?

Thanks!
     J.R. Allen
     Priddis, Alberta, Canada
0
Comment
Question by:JohnRobinAllen
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
pteranodon72 earned 250 total points
ID: 34930487
Paste all of the code from:

http://www.mvps.org/access/api/api0011.htm

into a new standard code module. You'll then be able to call fPlayStuff to play a file. Make sure to set the second parameter to pcsASYNC (1), so that operation doesn't freeze while the sound is playing.
This code is from a Access site, but it is not Access specific.
Hope this helps,

pT72
0
 

Author Comment

by:JohnRobinAllen
ID: 34932783
I look forward to trying this out. It appears to be for Access, while I need the program for Word. However, it might work with Word too. Time will tell, and I will post the results here in the next day or so.

       j.r.
0
 

Author Closing Comment

by:JohnRobinAllen
ID: 34960945
Many thanks!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now