PDA

View Full Version : [SOLVED:] User input video title when save the video



papuapu
06-07-2021, 05:30 AM
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

John Wilson
06-07-2021, 01:36 PM
This line
ActivePresentation.CreateVideo FileName:=Environ("USERPROFILE") & "\Desktop\myVideo.wmv", _

Needs to be

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

John Wilson
06-07-2021, 01:40 PM
For some reason Edit is not working! It should be
http://www.vbaexpress.com/forum/images/reputation/reputation_pos.pngJoinedFeb 2007Posts1,969Locationhttp://www.vbaexpress.com/forum/images/flags/United%20Kingdom%203D.gif


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

Needs to be

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

papuapu
06-07-2021, 09:09 PM
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

John Wilson
06-08-2021, 02:21 AM
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

papuapu
06-08-2021, 05:36 AM
Thanks sir,

Now working fine.