Class MediaFormat (PowerPoint VBA)

Contains methods and properties that allow access to and control over audio and video media.


To use a MediaFormat class variable it first needs to be instantiated, for example

Dim mft as MediaFormat
Set mft = ActiveWindow.RangeFromPoint.MediaFormat

The following procedures can be used to set variables of type MediaFormat: Shape.MediaFormat and ShapeRange.MediaFormat


Some procedures in this class have been grouped together in themes and are described on separate theme pages

Format with its procedures SampleHeight and SampleWidth
Display/Show with its procedures SetDisplayPicture and SetDisplayPictureFromFile


Other Methods

Resample - Adds the current media object to the queue and begins resampling, based on the specified parameters.



AudioCompressionType returns the audio compression format.

Dim strAudioCompressionType As String
strAudioCompressionType = ActiveWindow.RangeFromPoint.MediaFormat.AudioCompressionType

AudioSamplingRate returns the audio sampling rate per second for the media.

Dim lngAudioSamplingRate As Long
lngAudioSamplingRate = ActiveWindow.RangeFromPoint.MediaFormat.AudioSamplingRate

EndPoint gets or sets the time of the end point of the trim region of the media.

ActiveWindow.RangeFromPoint.MediaFormat.EndPoint =

FadeInDuration gets or sets the duration of the fade in of the media, in milliseconds.

ActiveWindow.RangeFromPoint.MediaFormat.FadeInDuration =

FadeOutDuration gets or sets the duration of the fadeout of the media, in milliseconds.

ActiveWindow.RangeFromPoint.MediaFormat.FadeOutDuration =

IsEmbedded returns whether the media file is embedded.

Dim booIsEmbedded As Boolean
booIsEmbedded = ActiveWindow.RangeFromPoint.MediaFormat.IsEmbedded

IsLinked returns whether the media file is linked.

Dim booIsLinked As Boolean
booIsLinked = ActiveWindow.RangeFromPoint.MediaFormat.IsLinked

Length returns the total length of the media in time units.

Dim lngLength As Long
lngLength = ActiveWindow.RangeFromPoint.MediaFormat.Length

MediaBookmarks returns a MediaBookmarks collection that represents the media bookmarks associated with the specified object.

Dim mbsMediaBookmarks As MediaBookmarks
Set mbsMediaBookmarks = ActiveWindow.RangeFromPoint.MediaFormat.MediaBookmarks

Muted returns whether audio playback of the media is muted. Read/write

ActiveWindow.RangeFromPoint.MediaFormat.Muted = True

Parent returns the parent object for the specified object. Read-only.

Dim objParent As Object
Set objParent = ActiveWindow.RangeFromPoint.MediaFormat.Parent

ResamplingStatus returns the resampling task status.

Dim pmtsResamplingStatus As PpMediaTaskStatus
pmtsResamplingStatus = ActiveWindow.RangeFromPoint.MediaFormat.ResamplingStatus

StartPoint gets or sets the start point of the trim region.

ActiveWindow.RangeFromPoint.MediaFormat.StartPoint =

VideoCompressionType returns a String that represents the video compression format of the media.

Dim strVideoCompressionType As String
strVideoCompressionType = ActiveWindow.RangeFromPoint.MediaFormat.VideoCompressionType

VideoFrameRate returns the video frame rate per second of the media.

Dim lngVideoFrameRate As Long
lngVideoFrameRate = ActiveWindow.RangeFromPoint.MediaFormat.VideoFrameRate

Volume gets or sets the volume of the media.

ActiveWindow.RangeFromPoint.MediaFormat.Volume =