Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-02-18
3
Medium Priority
?
575 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
[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
3 Comments
 
LVL 14

Accepted Solution

by:
pteranodon72 earned 1000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

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…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
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…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Suggested Courses

636 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