none
PowerPoint: How to read Video plays FullScreen by c# RRS feed

  • Question

  • Hey Guy!

    I am using PowerPoint 2013. If you insert a video on the slide, you can check at: Video Tools => Playback => "Play Full Screen"

    How do I get/set this checkbox by C#?

    Tuesday, February 14, 2017 2:24 PM

All replies

  • Hello,

    VSTO doesn't provide any property or method for that. I'd suggest asking PowerPoint specific questions on the General Office Development forum .


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Tuesday, February 14, 2017 4:31 PM
  • Hi dexit2k,

    I try to search in powerpoint object model but unfortunately I did not find anything useful that can solve your issue.

    I find 2 suggestions may help you.

    If Application.CommandBars.GetPressedMso("MoviePlayFullScreen") = False Then _
     Application.CommandBars.ExecuteMso ("MoviePlayFullScreen")

    Reference:

    VBA to set video to play in fullscreen

    in other thread I find that they try to set the height and width of video object to same as the width and height of ppt slide.

    Dim ovid As Shape 
    Dim osld As Slide 
    Set osld = ActiveWindow.View.Slide 
    Set ovid = osld.Shapes.AddMediaObject("C:\Users\Public\Videos\Sample Videos\Wildlife.wmv") 
    With osld.TimeLine.MainSequence.AddEffect(ovid, msoAnimEffectMediaPlay, , msoAnimTriggerWithPrevious) 
        .EffectInformation.PlaySettings.HideWhileNotPlaying = True 
    End With 
    ovid.LockAspectRatio = False 
    ovid.Width = ActivePresentation.PageSetup.SlideWidth 
    ovid.Height = ActivePresentation.PageSetup.SlideHeight 
    
    

    in the same thread I find the example below, in which they try to set .fullscreen property.

    when I test this code then I find that it only works for first time.

    Sub Add_player() 
        Dim osld As Slide 
        Dim oplayer As Shape 
        Set osld = ActivePresentation.Slides(1) 
        Set oplayer = osld.Shapes.AddOLEObject( _ 
        Left:=10, _ 
        Top:=10, _ 
        Width:=240, _ 
        Height:=160, _ 
        ClassName:="WMPlayer.OCX.7") 
        With oplayer.OLEFormat.Object 
            .URL = "C:\Users\Public\Videos\Sample Videos\Wildlife.wmv" 
            .fullScreen = True 
            .windowlessVideo = True 
        End With 
    End Sub 
    

    Reference:

    VBA video insertion for powerpoint

    Note: both the example are in VBA, I try to search example related c# but I did not find anything. so you can refer this code and try to develop it in c# language.

    I also try to find the oleformat.object property.

    in VBA:

    OLEFormat.Object Property (PowerPoint)

    in C#:

    Shape.OLEFormat Property

    but you can see that you can only get the value, it is read only. so we can't set the value.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, February 15, 2017 2:57 AM
    Moderator
  • My main issue is to read the option at runtime. I know the OM pretty good but it seems there is no hidden mapping of this option. I ask in this part of the forum for new ideas. I tried your ideas and more:

    • Shape.OLEFormat.Object
    • Shape.PictureFormat
    • Shape.PictureFormat.Crop
    • Shape.AnimationSettings
    • Shape.AnimationSettings.PlaySettings
    • Shape.MediaFormat
    • Slide.TimeLine.MainSequence
    • Slide.TimeLine.InteractiveSequences
    • View.Player

    I even tried to select the shape a runtime to execute "Application.CommandBars.GetPressedMso", but it didnt work.

    Thanks anyway!

    Wednesday, February 15, 2017 9:17 AM
  • We will follow the issue on the thread below.

    PowerPoint: How to read Video plays FullScreen by c#

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, February 16, 2017 6:57 AM
    Moderator