Windows 7 - VBA script to send a filename (drive/path) and launch to play WMP

Asked By hayash on 28-Aug-08 04:27 AM
Hi everyone,

Sorry if I post this in the wrong forum - please direct me if it's.

I would like to know how to write a VBA script to send a filename (e.g.
(wmp.ocx) as output.

I can see lots of these OCX files from the VBA Editor's Tools | References
- Window Media Encoder
- Window Media Encoder Agent
- Window Media Encoder Agent Locator
- Window Media Encoder Device Control
- Window Media Encoder Preview Control
- Window Media Player            C:\WINDOWS\system32\wmp.ocx
- Window Media Player            C:\WINDOWS\system32\msdxm.ocx
- Window Media Player Compatibility layer
- Window Media Player Launcher

But I don't know where to get these syntax and its parenthesis/parentheses

Appreciate if anyone can direct me with examples/samples would be a good
start.

Thanks in advance!

Regards.




Alessandro Angeli replied on 28-Aug-08 02:27 PM
From: "hayashi"

[...]

The API for WindowsMediaEncoder is documented in the
WindowsMediaEncoder SDK.

The API for WindowsMediaPlayer is documented in the
WindowsMediaPlayer SDK and recent Windows SDK and MSDN
Library.


The SDKs have some samples.

It is not clear how you want to play the file:

- embedded in your own application?

- running a new instance of the standalone player?

The latter is easy enough: just execute wmplayer.exe passing
it the filename on the commandline:

http://msdn.microsoft.com/en-us/library/bb262178(VS.85).aspx

How to execute external processes depends on the language
you use.

--
// Alessandro Angeli
// MVP :: DirectShow / MediaFoundation
// mvpnews at riseoftheants dot com
// http://www.riseoftheants.com/mmx/faq.htm
hayash replied on 28-Aug-08 08:50 PM
Hi Alessandro Angeli, thanks for taking your time to reply!

I need to know how to do the embedded one, that's playing video within
msaccess application itself.

That's right, the launching as standalone instance, I got the command to run
it by executing the "Shell()" fiunction - this is easy.

I will try to read more from what you've suggested and directed (SDK)

What I really need are those sample of codes that can get me kicking
rightaway.

Thanks again Alessandro Angeli.

Hope you can assist me again when I post back from my finding later.

Best Regards, Hayashi