Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-08-2017, 04:41 AM
shiva_b shiva_b is offline convert multiple pptx files into mp4 videos using vba Windows 10 convert multiple pptx files into mp4 videos using vba Office 2016
Novice
convert multiple pptx files into mp4 videos using vba
 
Join Date: Mar 2017
Posts: 1
shiva_b is on a distinguished road
Default

HI,




I have hundred's of pptx files along with excel files in a folder. I want to convert all selected pptx files into individual hd videos(in mp4 format) and save into another folder by using vba. pls help.

Note: iam using office 2016.

i wrote a code for this. but few lines of code is not working properly (code colored with blue) pls go through the below code and help me.

Code:
   Option Explicit

Sub GetFolderPath()
Dim InputFolder As String
Dim OutputFolder As String
Dim fd1, fd2 As FileDialog
Dim cpath, dpath As String
 Dim FileInFromFolder As Object
Dim fil As Scripting.File
Dim cfolder, dfolder As Scripting.Folder
'-----------------------------------------------------------------------------------------
Dim fso As Scripting.filesystemobject
Dim actionclicked As Boolean
Set fso = New Scripting.filesystemobject
Set fd1 = Application.FileDialog(msoFileDialogFolderPicker)
Set fd2 = Application.FileDialog(msoFileDialogFolderPicker)

fd1.Title = "pick the folder to save files into"
fd1.AllowMultiSelect = False
actionclicked = fd1.Show
If actionclicked Then
InputFolder = fd1.SelectedItems(1)
Else
MsgBox "You didn't pick a folder"
Exit Sub
End If
If InputFolder = "" Then
MsgBox "Select a folder then click Yes"
Exit Sub
End If
cpath = InputFolder

   Set fso = New Scripting.filesystemobject

Set cfolder = fso.GetFolder(cpath)
cpath = Replace(cpath, "\\", "\")
Debug.Print cfolder


Set fd2 = Application.FileDialog(msoFileDialogFolderPicker)
fd2.Title = "pick the folder to save files into"
fd2.AllowMultiSelect = False
actionclicked = fd2.Show
If actionclicked Then
OutputFolder = fd2.SelectedItems(1)
Else
MsgBox "You didn't pick a folder"
Exit Sub
End If
If OutputFolder = "" Then
MsgBox "Select a folder then click Yes"
Exit Sub
End If
dpath = OutputFolder


   Set fso = New Scripting.filesystemobject

Set dfolder = fso.GetFolder(dpath)
dpath = Replace(dpath, "\\", "\")


'Debug.Print dfolder
For Each fil In cfolder.Files

    If Left(fso.GetExtensionName(fil.Path), 2) = "pp" And Format(fil.DateLastModified, "dd/mm/yyyy") = Format(Date, "dd/mm/yyyy") Then
    Application.ActivePresentation.SaveAs _
        FileName:=dpath & "\" & fil.Name & ".mp4", _
        FileFormat:=ppSaveAsMP4
        
        End If
        
Next
End Sub
Thank you in advance.
Reply With Quote
  #2  
Old 05-02-2017, 05:05 PM
macropod's Avatar
macropod macropod is offline convert multiple pptx files into mp4 videos using vba Windows 7 64bit convert multiple pptx files into mp4 videos using vba Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Cross-posted at: http://www.vbaexpress.com/forum/show...thod-using-vba
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184

I note also this is the fourth thread you have started here on this topic. Kindly don't do that. I've merged two and deleted the other two.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert PPTX to MP4 Robin Chapple PowerPoint 3 03-18-2015 02:46 PM
The powerpoint icon on the task bar hides pptx files in the recent files list Innovationgame PowerPoint 0 11-13-2013 09:03 AM
How can I convert pptx to text format like Word, and later on create pptx too? GetLost PowerPoint 0 01-11-2012 04:23 AM
convert multiple pptx files into mp4 videos using vba convert multiple csv files to multiple excel files mit Excel 1 06-14-2011 10:15 AM
Bulk convert Powerpoint XML files to PPT or PPTX RileyT PowerPoint 0 11-21-2010 04:16 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:44 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft