Solved

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

Posted on 2011-02-18
3
545 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
Shortcuts in Word Just the other day I had a training for Microsoft and they wanted me to show how well the new Windows and Office behaved on a touch device, which by the way is great, but it was only then that I realized that using keyboard shortc…
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

929 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

11 Experts available now in Live!

Get 1:1 Help Now