penelope112358
asked on
wmv in ms word
How is it possible to embed and play .wmv files in MS Word 2003?
thanks, Penelope
thanks, Penelope
ASKER
Hello darbid73,
thanks for helping me with this and submitting detailed code. In startme2() I didn't use the & in the string name, just used &.
I was able to insert the plug in and attached your code in "This document" but can't get it to run, wonder what I might have overlooked. For your reference I have attached that document.
For the size I will experiment with these parameters:
mpFitToSize
mpFullScreen
1
2
3
Liglin
Sample-embedded.doc
thanks for helping me with this and submitting detailed code. In startme2() I didn't use the & in the string name, just used &.
I was able to insert the plug in and attached your code in "This document" but can't get it to run, wonder what I might have overlooked. For your reference I have attached that document.
For the size I will experiment with these parameters:
mpFitToSize
mpFullScreen
1
2
3
Liglin
Sample-embedded.doc
Ok it has been a while, so throw out the code I gave you as that is for the old Media Player.
With yours it is probably very simple.
With this one I put the code in the open document routine otherwise it starts automatically.
This will let you click the play button if you want.
If you make other buttons for your word doc then you would need to change the path in this click routine and would need "WindowsMediaPlayer1.Contr ols.play" at the end to play it. You will see at the end of "WindowsMediaPlayer1.Contr ols" that you can play and stop etc without using the buttons of the actual media player.
With yours it is probably very simple.
With this one I put the code in the open document routine otherwise it starts automatically.
This will let you click the play button if you want.
If you make other buttons for your word doc then you would need to change the path in this click routine and would need "WindowsMediaPlayer1.Contr
Private Sub Document_Open()
Dim strName As String
strName = strPATHNAME & "all.wmv" 'your file name
WindowsMediaPlayer1.windowlessVideo = True
WindowsMediaPlayer1.settings.autoStart = False 'stop it from automatically starting on load
WindowsMediaPlayer1.URL = strName 'add the path to your file
WindowsMediaPlayer1.settings.volume = 100 'here you can change initial volume
WindowsMediaPlayer1.settings.setMode "loop", False 'stop it from looping
End Sub
ASKER
Thanks for the new much simpler code. I have put the code into Microsoft Word Objects "ThisDocument" but the Object still won't run...
Sample-embedded.doc
Sample-embedded.doc
ASKER
Looking at the sample I have included in the previous post, is it possible that I have perhaps attached the code incorrectly?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Darbid73. I got it to work. Great help!! You really made a difference!!!
ASKER
Excellent help!! Thanks again very much.
On the View menu, point to Toolbars, and click Control Toolbox.
In the Control Toolbox, click More Tools.
In the list of available ActiveX Controls, click Windows Media Player.
Draw the control somewhere on your form.
Then you will need code like this
Open in new window