# HELP!  I need a Macro quick!

**URL:** <https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783>\
**Category:** Factual Questions\
**Created:** [March 29, 2002, 5:34pm UTC](https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783 "2002-03-29T17:34:49Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johnny\_L.A](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johnny_l.a/32/1084_2.png) [@Johnny\_L.A](https://boards.straightdope.com/u/Johnny_L.A)\
**Post date:** [March 29, 2002, 5:34pm UTC](https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783/1 "2002-03-29T17:34:49Z")

</div>

Okay, I found a .wav that I want to attach to my performance review. (It’s Johnny Bravo saying, “Man, I’m pretty!”) I’ve put the file into the document, and it can be played by right-clicking on it and clicking on “play”. But what I want is to have it play automatically upon opening the document.

I know nothing about writing macros.

Can someone tell me how to make the .wav play upon opening the document, and/or write the macro text that (I think) I can put into the file?

Many thanks!

---

<div class="post-metadata">

**Author:** ![Waverly](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@Waverly](https://boards.straightdope.com/u/Waverly)\
**Post date:** [March 29, 2002, 7:34pm UTC](https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783/2 "2002-03-29T19:34:04Z")

</div>

Performance review? Before I answer this, can I just point out what a horrible idea it is? OK. Conscience cleared:

You don’t say what program you are using, but I’ll assume for a moment you are using Word. Macros in Word need to be initiated (usually from a button or menu.) You could save the document out as an html, in which case you could script it, or use a program designed to create something more along the lines of a presentation (ie Powerpoint or possibly Acrobat.)

---

<div class="post-metadata">

**Author:** ![Johnny\_L.A](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johnny_l.a/32/1084_2.png) [@Johnny\_L.A](https://boards.straightdope.com/u/Johnny_L.A)\
**Post date:** [March 29, 2002, 9:53pm UTC](https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783/3 "2002-03-29T21:53:13Z")

</div>

Thanks Waverly. You’re right that I’m using MS-Word. I should have mentioned that. It has to stay in Word, so I can’t use Powerpoint or Acrobat. (Besides, I don’t know how to use those.) I didn’t see any buttons in Word that said anything obvious like “Play .wav upon opening document”.

Horrible idea? If I didn’t do something wacky, they’d think something had happened to me! I can always just leave the .wav at the top of the document with an arrow that says “Click Here!” next to it, I guess. But a macro would be totally groove-O.

(And if it really _is_ a horrible idea, maybe they’ll finally lay me off so I can get my severence package and move up north! 😃 )

---

<div class="post-metadata">

**Author:** ![erislover](https://avatars.discourse-cdn.com/v4/letter/e/71e660/32.png) [@erislover](https://boards.straightdope.com/u/erislover)\
**Post date:** [March 30, 2002, 4:48am UTC](https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783/4 "2002-03-30T04:48:25Z")

</div>

Hmm, been trying to play around with this… you shouldn’t need to use a macro at all. I’m using Word 2000 and I can put an embedded wav file directly into the document, but I think it converts it to HTML when I do that…

I’ll keep digging. I didn’t see anythign in VB after a quick search.

---

<div class="post-metadata">

**Author:** ![AHunter3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ahunter3/32/368_2.png) [@AHunter3](https://boards.straightdope.com/u/AHunter3)\
**Post date:** [March 30, 2002, 6:09am UTC](https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783/5 "2002-03-30T06:09:13Z")

</div>

Why don’t you create a batch file that opens the sound file first (which should cause it to play, right?) and then opens the word processor document?

Then you just double-click the batch file.

Or you could do yourself a favor and buy QuicKeys for Windows, which is a nice all-around and versatile macro program.

[http://www.cesoft.com](http://www.cesoft.com)

---

<div class="post-metadata">

**Author:** ![Johnny\_L.A](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johnny_l.a/32/1084_2.png) [@Johnny\_L.A](https://boards.straightdope.com/u/Johnny_L.A)\
**Post date:** [March 30, 2002, 2:39pm UTC](https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783/6 "2002-03-30T14:39:40Z")

</div>

> [@](#):
>
> Hmm, been trying to play around with this… you shouldn’t need to use a macro at all. I’m using Word 2000 and I can put an embedded wav file directly into the document, but I think it converts it to HTML when I do that…

I’m not sure which version of Word I’m using at work, but the OS is Win2K. I’ve inserted the file into the document. When I doub;e-clicked it, it played once and then would not play again. I found something in Word (don’t remember what) thatsaid “convert”. When I clicked on that, I shoce the only option which was “media file”. After that I could replay the wav.

> [@](#):
>
> Why don’t you create a batch file that opens the sound file first (which should cause it to play, right?) and then opens the word processor document?

Unfortunately I don’t know how to write a batch file. But in any case, wouldn’t that require the recipient to know that he had to open a .bat file instead of a Word document? I’d rather he not be in on the joke.

[sub](BTW: the only vB code I know is what I use on these boards.)[/sub]

---

<div class="post-metadata">

**Author:** ![Waverly](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@Waverly](https://boards.straightdope.com/u/Waverly)\
**Post date:** [March 30, 2002, 3:13pm UTC](https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783/7 "2002-03-30T15:13:04Z")

</div>

Buttons can be found in View:Toolbars:ControlToolbox. The specific tool is the Command Button. You can then either link the macro, cut and paste the code, or write it in yourself. To be honest though, the effect isn’t much different from embedding the sound file and requiring it’s icon to be clicked.

---

<div class="post-metadata">

**Author:** ![AHunter3](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ahunter3/32/368_2.png) [@AHunter3](https://boards.straightdope.com/u/AHunter3)\
**Post date:** [March 30, 2002, 8:15pm UTC](https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783/8 "2002-03-30T20:15:22Z")

</div>

Johnny LA:

> [@](#):
>
> Unfortunately I don’t know how to write a batch file.

Lordy, so now we’ve got Mac users telling PC users how to write a batch file? Don’t y’all have to pass a geek license exam before they let you use them things?

Let’s see… PC batch files…

I’m pretty sure you just type out the file path to the files, with a hard return between the first one and the second. e.g.,

batch file =

> [@](#):
>
> C:\Windows\Desktop\soundfile.wav  
> C:\Windows\Desktop\PerfRev.doc

You write it in a text editor like NotePad, and save it under any title you want as long as it ends in “.bat” – My Performance Review.bat

> [@](#):
>
> But in any case, wouldn’t that require the recipient to know that he had to open a .bat file instead of a Word document? I’d rather he not be in on the joke.

Oh, are you sending it to someone via email? Hmm, I see your point. OK, store the soundfile and the actual performance review document on a server that both your computer and the recipient’s computer have access to. (All offices have server space set up for common use, yes?) Then send only the batch file:

batch file=

> [@](#):
>
> “\NTSERVERNAME\Shares\Johnny’s Performance Review\soundfile.wav”  
> “\NTSERVERNAME\Shares\Johnny’s Performance Review\PerfRev.doc”

(note the quotes)

---

<div class="post-metadata">

**Author:** ![Johnny\_L.A](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/johnny_l.a/32/1084_2.png) [@Johnny\_L.A](https://boards.straightdope.com/u/Johnny_L.A)\
**Post date:** [March 31, 2002, 3:45pm UTC](https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783/9 "2002-03-31T15:45:32Z")

</div>

Thanks, I’ll try it on Monday.

---

<div class="post-metadata">

**Author:** ![micilin](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@micilin](https://boards.straightdope.com/u/micilin)\
**Post date:** [March 31, 2002, 3:56pm UTC](https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783/10 "2002-03-31T15:56:56Z")

</div>

Or you could try this:

[http://support.microsoft.com/support/kb/articles/Q211/6/59.ASP](http://support.microsoft.com/support/kb/articles/Q211/6/59.ASP)

Basically record a macro called ‘AutoOpen’ and make sure its saved in the document, not your normal.dot file (using the macro ‘Organiser’), unless, of course, you want that wav to play everytime you open a … 🙂

---

<div class="post-metadata">

**Author:** ![micilin](https://avatars.discourse-cdn.com/v4/letter/m/8c91f0/32.png) [@micilin](https://boards.straightdope.com/u/micilin)\
**Post date:** [March 31, 2002, 3:58pm UTC](https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783/11 "2002-03-31T15:58:38Z")

</div>

> [@](#):
>
> \*Originally posted by micilin \*  
> unless, of course, you want that wav to play everytime you open a … 🙂

erm, a word document, that is.

(Preview, preview, preview)

---

<div class="post-metadata">

**Author:** ![K364](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/k364/32/5_2.png) [@K364](https://boards.straightdope.com/u/K364)\
**Post date:** [March 31, 2002, 7:24pm UTC](https://boards.straightdope.com/t/help-i-need-a-macro-quick/100783/12 "2002-03-31T19:24:55Z")

</div>

Once you create your autoopen macro, it’ll need some code to launch the sound file:

[Have a look here](http://support.microsoft.com/default.aspx?scid=kb;en-us;Q170730)
