How do I set the default save format in PowerPoint

2019-07-23 08:16发布

问题:

Microsoft, in their infinite wisdom, decided that the default file format for Office 2010 applications should be the format that was 13 years old (Office 97-2002) at the time of release.

The newer formats (2007 and newer) save the data in compressed XML files which are much smaller, and also allow for many additional features. Our corporate IT department hasn't or can't set a group policy to force users to default to saving in the new format, so I'm writing a macro to adjust the settings for everyone in our department.

I can do this in Excel and Word very simply by executing the following VBA code (I'm running it from an Excel workbook):

Public Sub SetExcelSave()

  Dim myExcel As Excel.Application

  Set myExcel = New Excel.Application
  Excel.DefaultSaveFormat = xlOpenXMLWorkbook
  Excel.Quit

  Set Excel = Nothing

End Sub

Public Sub SetWordSave()

  Dim myWord As Word.Application
  Set myWord = New Word.Application

  Word.DefaultSaveFormat = wdFormatDocumentDefault
  Word.Quit

  Set Word = Nothing

End Sub

However, I haven't been able to find the appropriate setting to adjust in PowerPoint. Does anyone know where that property is or what it's called?

This code will not compile cleanly, giving an error on the PPT.DefaultSaveFormat line:

Public Sub SetPowerPointSave()

  Dim PPT As PowerPoint.Application
  Set PPT = New PowerPoint.Application

  PPT.DefaultSaveFormat = ppSaveAsOpenXMLPresentation
  PPT.Quit

  Set PPT = Nothing

End Sub

I've rummaged around in the Office Application Object documentation for PowerPoint, but I'm just not finding what I'm after. It's highly likely that I just don't know what I'm looking for and have simply overlooked it.

Does anyone know what property I'm supposed to set to be able to programmatically change this?

回答1:

The default save format for PPT 2007 and later is the new XML format (PPTX rather than PPT and so on). If the user (or IT staff via policies) have overridden this in the File | Save | Save files in this format: then the default becomes whatever they've selected, for whatever reason.

App-wide defaults like this typically aren't exposed via the object model; they're stored in the registry. In this case, in

HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\PowerPoint\Options

DefaultFormat DWORD=27 for PPTX

Substitute the correct version for 14.0 above; 12.0 for PPT 2007, 14.0 for 2010, and so on (no 13.0).

If you can write the value you want to the registry when PPT isn't running, you can reset the defaults. If you write to the reg while PPT's running, it won't affect the current instance of PPT, and your changes will be overwritten when PPT quits.