Scale a windows mediaplayer movie in userform

espenskeie

Well-known Member
Joined
Mar 30, 2009
Messages
632
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
 

Some videos you may like

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

bensonsearch

Well-known Member
Joined
May 26, 2011
Messages
844
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
 

espenskeie

Well-known Member
Joined
Mar 30, 2009
Messages
632
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
 

espenskeie

Well-known Member
Joined
Mar 30, 2009
Messages
632

ADVERTISEMENT

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
 

bensonsearch

Well-known Member
Joined
May 26, 2011
Messages
844
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:

espenskeie

Well-known Member
Joined
Mar 30, 2009
Messages
632

ADVERTISEMENT

Hello

I have Office 10, and Windows 7 on my computer.
 

espenskeie

Well-known Member
Joined
Mar 30, 2009
Messages
632
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
 

Watch MrExcel Video

Forum statistics

Threads
1,123,088
Messages
5,599,664
Members
414,325
Latest member
kfg1287

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
Top