1

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?

Community
  • 1
  • 1
FreeMan
  • 5,660
  • 1
  • 27
  • 53
  • I'm looking to and the `DefaultSaveFormat` isn't in there, neither in Object Browser... I was looking in `FileConverter`, `Options`, `FileValidation` but I don't see what it could be... Most of them are *read-only* :/ – R3uK Oct 10 '16 at 15:28
  • 1
    Based on my limited experience so far, it seems that MS really doesn't want people using VBA on PPT. :( – FreeMan Oct 10 '16 at 15:31
  • Yeah, I haven't the faintest clue of where else to look for... I don't even find an enum for file formats... Doesn't look good indeed... Try to post on official MS forum, who knows... Good luck with that! You may have do some [tag:.net]^^ – R3uK Oct 10 '16 at 15:41

1 Answers1

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.

Steve Rindsberg
  • 14,442
  • 1
  • 29
  • 34
  • Wow, thank you VERY much! It took me a couple of minutes to register that `defaultformat` is the key located in ..\Options, since there is a key called `Options` in the ..\PowerPoint path. However, once I figured that out, it's working like a charm. +1 & a check mark for you! – FreeMan Oct 10 '16 at 19:51
  • @FreeMan Glad to hear it ... thanks for letting us know. – Steve Rindsberg Oct 10 '16 at 20:21