如何以编程方式获取PowerPoint文件格式 [英] How to obtain PowerPoint File Format Programmatically
本文介绍了如何以编程方式获取PowerPoint文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要确定ActivePresentation
是97-2003还是2007格式.我真的不想检查扩展名.
I need to determine whether the ActivePresentation
is 97-2003 or 2007 format. I really won't want to check the extension.
PowerPoint对象模型内部是否有提供此信息的属性?
Is there a property somewhere inside the PowerPoint Object Model which gives this info?
推荐答案
没有文件格式属性.您必须走扩展路线,例如:
There is no File Format property, unfortunately. You'll have to go the extention route, like:
Sub APFileFormat()
Dim ap As Presentation
Set ap = ActivePresentation
Length = Len(ap.Name)
Match = InStrRev(StringCheck:=ap.Name, StringMatch:=".")
ExtentionLength = Length - Match
Select Case ExtentionLength
Case 4
FileFormat = "PowerPoint 2007-2010"
Case 3
FileFormat = "PowerPoint 97-2003"
Case Else
FileFormat = "undetermined"
End Select
Debug.Print "The file format of the active presentation is " & FileFormat
End Sub
这篇关于如何以编程方式获取PowerPoint文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文