Dateiformat der Präsentation abrufen

Um das Dateiformat zu erhalten, folgen Sie bitte den untenstehenden Schritten:

  • Erstellen Sie eine Instanz der Klasse IPresentationInfo
  • Rufen Sie Informationen zur Präsentation ab

Im nachstehenden Beispiel haben wir das Dateiformat ermittelt.

Beispiel


 string FilePath = @"..\..\..\Sample Files\";

string FileName = FilePath + "Getting the format of a file.pptx";

IPresentationInfo info;

info = PresentationFactory.Instance.GetPresentationInfo(FileName);


switch (info.LoadFormat)

{

    case LoadFormat.Pptx:

        {

            break;

        }

    case LoadFormat.Unknown:

        {

            break;

        }

}

Beispielcode herunterladen

Laufendes Beispiel herunterladen