Sub SaveAsDocx()
Dim file
Dim path As String
path = "C:\Test\" 'your folder here
file = Dir(path & "*.docm")
Do While file <> ""
Documents.Open FileName:=path & file
ActiveDocument.SaveAs2 FileName:=path & file, FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", _
AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
:=False, SaveAsAOCELetter:=False, CompatibilityMode:=15
ActiveDocument.Close
file = Dir()
Loop
End Sub
Sub SaveWithoutMacros()
With ActivePresentation
MsgBox "Saving " & Chr(34) & .Name & Chr(34) & " as : " & vbCrLf _
& Replace(.Name, ".pptm", ".pptx") & " here : " & vbCrLf _
& .Path
.SaveAs FileName:="NoMacros.pptx", FileFormat:=ppSaveAsOpenXMLPresentation
End With
End Sub
Option Explicit
Sub DeleteVBA()
' Trust Access To Visual Basic Project must be enabled:
' Tools | Macro | Security | Trusted Sources
Dim lComp As Long
Dim lLine As Long
On Error Resume Next
With ActiveWorkbook.VBProject
For lComp = .VBComponents.Count To 1 Step -1
.VBComponents.Remove .VBComponents(lComp)
Next
For lLine = .VBComponents.Count To 1 Step -1
.VBComponents(lLine).CodeModule.DeleteLines _
1, .VBComponents(lLine).CodeModule.CountOfLines
Next
End With
On Error GoTo 0
End Sub
Take a look, it should work just fine and then you can tweak for other file extension.
https://msdn.microsoft.com