Scale a windows mediaplayer movie in userform

espenskeie

Well-known Member
Joined
Mar 30, 2009
Messages
636
Office Version
  1. 2016
Platform
  1. Windows
Hi

I try to run videos in a userform, but the video is to big for my screen and userform. Is it possible to scale it such that it will fit for example to full screen or some other userform size?

The video size is:
Width 1920
Height 1080

Regards
Espen
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi,
I assume you are using the windows media player control. if so then there is an option to streatch the video to fit . this makes it the same size as the player field on the form.

the exact wording of the property is: stretchToFit
 
Upvote 0
Hello

I did try that but nothing happened.... I also tried the same with a fullscreen code, but that one just errored.

And if I try to do it in the property window, but there it just reset its values when I run the macro.

Regards
Espen
 
Upvote 0
Hello bensonsearch

I have tried some different applies, but these are my codes for the moment:


Code:
Option Explicit

Const strPATHNAME As String = "C:\Users\SafeEspen\Desktop\SalesTools\Video\Axis P3367-VE.wmv"

Private Sub CommandButton1_Click()
WindowsMediaPlayer1.Controls.Stop
End Sub

Private Sub Play_Click()

 With WindowsMediaPlayer1
        .URL = strPATHNAME
        .Controls.Play
    End With
    
End Sub

Private Sub UserForm_Initialize()

    Application.WindowState = xlMaximized
    Me.Top = Application.Top
    Me.Left = Application.Left
    Me.Width = Application.Width
    Me.Height = Application.Height
    
End Sub

Private Sub WindowsMediaPlayer1_OpenStateChange(ByVal NewState As Long)
    WindowsMediaPlayer1.stretchToFit = True
    'WindowsMediaPlayer1.fullScreen = True
End Sub
 
Upvote 0
Hi, what version of office are you using? my windows media control has its own stop and play buttons

I have also copied your code and it works fine for me, the media player control stays the same size as i had it on my form
 
Last edited:
Upvote 0
Thank you for the link. I try to look at it and see if I can get it working.

Unfortunately there are little video-player stuff in userforms to search for on internet.

I'll try to open a new workbook to see if it's better there.

Regards
Espen
 
Upvote 0

Forum statistics

Threads
1,213,550
Messages
6,114,265
Members
448,558
Latest member
aivin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top