Consulting

Results 1 to 6 of 6

Thread: User input video title when save the video

  1. #1
    VBAX Regular
    Joined
    Sep 2020
    Posts
    6
    Location

    User input video title when save the video

    Sir,

    I want to give title name when save the powerpoint presentation in wmv format. I found the code in web to save the video in wmv format but now I want to give title name to that video. I run the following code but not working & saving all video as myVideo.wmv.



    Sub PowerPointVideo()

    Dim myVideo As String


    If ActivePresentation.CreateVideoStatus <> ppMediaTaskStatusInProgress Then


    myVideo = InputBox("Please enter title name ", "Add Title ")
    If myVideo = "" Then
    MsgBox "You enter nothing Operation Aborted!"
    Exit Sub
    End If


    ActivePresentation.CreateVideo FileName:=Environ("USERPROFILE") & "\Desktop\myVideo.wmv", _
    UseTimingsAndNarrations:=True, _
    VertResolution:=1080, _
    FramesPerSecond:=30, _
    Quality:=100
    Else: MsgBox "There is another conversion to video in progress"
    End If
    End Sub

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    1,999
    Location
    This line
    ActivePresentation.CreateVideo FileName:=Environ("USERPROFILE") & "\Desktop\myVideo.wmv", _

    Needs to be

    ActivePresentation.CreateVideo FileName:=Environ("USERPROFILE") & "\Desktop" & myVideo & ".wmv", _
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Master
    Joined
    Feb 2007
    Posts
    1,999
    Location
    For some reason Edit is not working! It should be
    JoinedFeb 2007Posts1,969Location

    This line
    ActivePresentation.CreateVideo FileName:=Environ("USERPROFILE") & "\Desktop\myVideo.wmv", _

    Needs to be

    ActivePresentation.CreateVideo FileName:=Environ("USERPROFILE") & "\Desktop\ & myVideo & ".wmv", _

    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  4. #4
    VBAX Regular
    Joined
    Sep 2020
    Posts
    6
    Location
    Thanks Sir,

    when we put this line
    ActivePresentation.CreateVideo FileName:=Environ("USERPROFILE") & "\Desktop\ & myVideo & ".wmv", _

    Got error stating:

    Compile error:
    Expected: end of statement


    with highlighted "." before wmv

  5. #5
    VBAX Master
    Joined
    Feb 2007
    Posts
    1,999
    Location
    I guess you are making a mistake then

    Sub PowerPointVideo()
    
    Dim myVideo As String
    
    
    If ActivePresentation.CreateVideoStatus <> ppMediaTaskStatusInProgress Then
    
    
    myVideo = InputBox("Please enter title name ", "Add Title ")
    If myVideo = "" Then
    MsgBox "You enter nothing Operation Aborted!"
    Exit Sub
    End If
    
    
    ActivePresentation.CreateVideo FileName:=Environ("USERPROFILE") & "\Desktop\" & myVideo & ".wmv", _
    UseTimingsAndNarrations:=True, _
    VertResolution:=1080, _
    FramesPerSecond:=30, _
    Quality:=100
    Else: MsgBox "There is another conversion to video in progress"
    End If
    End Sub
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  6. #6
    VBAX Regular
    Joined
    Sep 2020
    Posts
    6
    Location
    Thanks sir,

    Now working fine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •