Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 20th, 2008, 08:58 AM
Registered User
 
Join Date: Oct 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Rob

Im in the form code application on the top of the form
from left to right where should the selection be named in the list box

thanks

Edmund


Quote:
quote:Originally posted by robzyc
 Hi LouG

Sorry for the delayed reply, been meaning to reply to this one for a while.

Now Ive not used WMP in forms myself as sadly most my business work doesnt let us have in-software players for fun!

Right, you say you have added the WMP control to your form yes?

I have done the same and called the control "wmp".

All you then need to do is in your form code:
Code:
    Dim player As WindowsMediaPlayer
    Set player = wmp.Object

    With player
        'Enter code here.
    End With


You now have access to all the properties/methods of the object, although I cant help with those as I have never used them!

Hope this helps,
Regards,
Rob

 
Old October 20th, 2008, 09:17 AM
Registered User
 
Join Date: Oct 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey rob

please tell me the errors on this code
this is how its reading

Private Sub WindowsMediaPlayer0_Enter()
Dim player As WindowsMediaPlayer
    Set player = wmp.Object
With player
        WMPlayer.OCX 0.7
End With



Quote:
quote:Originally posted by robzyc
 Hi LouG

Sorry for the delayed reply, been meaning to reply to this one for a while.

Now Ive not used WMP in forms myself as sadly most my business work doesnt let us have in-software players for fun!

Right, you say you have added the WMP control to your form yes?

I have done the same and called the control "wmp".

All you then need to do is in your form code:
Code:
    Dim player As WindowsMediaPlayer
    Set player = wmp.Object

    With player
        'Enter code here.
    End With


You now have access to all the properties/methods of the object, although I cant help with those as I have never used them!

Hope this helps,
Regards,
Rob

 
Old October 20th, 2008, 10:12 AM
Registered User
 
Join Date: Oct 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey al

i've been working on this for days i just need to say thanks i copied your code and you said something i caught that was real important i believe, and it was you had entered the code before inputting the media player. its still tricky to open the browser to import the url string but its all good. thanks i was really dead in the water.

Thanks Again

Edmund







Quote:
quote:Originally posted by Ald
 
Quote:
quote:Originally posted by duno2002
Quote:
 I'm a Java developer but I'm running into the same problem that you described here. I've searched the web but I can't find anything except for what you've discussed here.

When I try to create the OLE object using "WMPlayer.ocx" as the program id, I get the same -2147467259 automation error. This used to work in previous versions of Windows Media Player.

I'm just trying to gather some info so that I can make my java code works again.

Can you tell me exactly what you had to do to make your call:

Set objPlayer = CreateObject(“WMPlayer.ocx”)

to work again? I have the equivalent call to CreateObject in Java.

Thanks,
Duno

Duno, I'm a real beginner at this stuff. Here is what I did:
    In MS Access, in my main form VBA Code, I put:
         Option Compare Database
         Dim player As WindowsMediaPlayer
         Set player = WMP.Object
    after I drag & drop the WindowsMediaPlayer control from the tool bar "More controls" button. This is giving you the Play, Pause, Next...buttons. When you look at the "properties" of this control, (in design mode of the form) you can see the following:
     Name : WMP (my own choice of name here)
     OLE Class: Windows Media Player
     Verb: 0
     Class: WMPlayer.OCX.7
In the Event "On Got Focus" event procedure I have the following code: WMP.URL = MyFile
where MyFile is the full path of a .MP3 file or a .WPL file (playlist create with the real Windows Media Player) and plays it.

So far, so good.

My next step is to work with the Playlists. I Have not been able to load a playlist and get each item specs (Title, Artist, duration,...)
Some how, by using a *.WPL file with the command WMP.URL, it is considered as a url not as a playlist. It plays it but I can't figure out how to get playlist details. Since I'm a beginner, I'm struggling with the different syntax of methods / property / action / etc... of the Object Browser.

Hope this will help you.

If ever you have some sample code on how to used and code all of these "methods / property / action / etc..." I would appreciate it.

Thanks

Al





Similar Threads
Thread Thread Starter Forum Replies Last Post
Media player in PHP tanzi PHP How-To 0 July 20th, 2008 11:53 PM
Windows Media Player 10 gigamars04 VB.NET 1 December 17th, 2007 12:12 AM
Media player COM reference Apocolypse2005 Visual Basic 2005 Basics 2 November 4th, 2007 12:14 PM
Windows Media Player 1g0r Pro VB 6 0 October 16th, 2006 12:51 AM
Creating a Media player(mainley mp3 and wma) Apocolypse2005 Beginning VB 6 0 June 7th, 2005 11:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.