HELP! I need a Macro quick!

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!

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.)

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! :smiley: )

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.

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

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.

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]

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.

Johnny LA:

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 =

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

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=

(note the quotes)

Thanks, I’ll try it on Monday.

Or you could try this:

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 … :slight_smile:

erm, a word document, that is.

(Preview, preview, preview)

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

Have a look here