[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 587
  • Last Modified:

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

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
JohnRobinAllen
Asked:
JohnRobinAllen
  • 2
1 Solution
 
pteranodon72Commented:
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
 
JohnRobinAllenAuthor Commented:
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
 
JohnRobinAllenAuthor Commented:
Many thanks!
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now