Previous  Home  Next

PowerPoint Version

Application.Version returns the version of the copy of PowerPoint you're running, but it comes back as a string.

Often, you need to do a numeric comparison. For example:

' Are we running PowerPoint 2000 or higher?  8 is PowerPoint 97
If Application.Version > 8 Then 
	' Do something or other
End If

You could use CInt to convert the .Version string to an Integer:

If CInt(Application.Version) > 8 Then 
	' Do something or other
End If

That works most of the time but it blows up in certain releases of PowerPoint 97, which identify themselves as "8.0b", which causes CInt to error out.

Instead, use this:

Function PowerpointVersion() As Integer
	PowerpointVersion = CInt(Val(Application.Version))
End Function

So:

If PowerPointVersion > 8 Then
	' Do stuff appropriate for PowerPoint 2000 and up
Else
	' Do stuff that's safe in PowerPoint 97
End If

Previous  Home  Next