Class MediaBookmark (PowerPoint VBA)

Contains properties and methods that specify information about the bookmark of the media.

Set

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

Dim mbk as MediaBookmark
Set mbk = ActiveWindow.RangeFromPoint.MediaFormat.MediaBookmarks(Index:=1)

The following procedures can be used to set variables of type MediaBookmark: MediaBookmarks.Item, MediaBookmarks.Add and MediaFormat.MediaBookmarks

Delete

Deletes the bookmark from the collection.

ActiveWindow.RangeFromPoint.MediaFormat.MediaBookmarks(1).Delete

Index

Returns the index position of the bookmark.

Dim lngIndex As Long
lngIndex = ActiveWindow.RangeFromPoint.MediaFormat.MediaBookmarks(1).Index

Name

Returns the name of the bookmark.

Dim strName As String
strName = ActiveWindow.RangeFromPoint.MediaFormat.MediaBookmarks(1).Name

Position

Returns the time that is associated with the bookmark.

Dim lngPosition As Long
lngPosition = ActiveWindow.RangeFromPoint.MediaFormat.MediaBookmarks(1).Position

MediaBookmarks.Add

Adds a new MediaBookmark at the specified time and using the specified name.

The collection is automatically re-sorted incrementally by time. This method returns an error if the bookmark already exists at that position, if the maximum number of bookmarks exceeds 512, or if the user tries to assign a name that has a length greater than 255 characters.

Syntax : expression.Add (Position, Name)

Dim lngPosition As Long: lngPosition = 
Dim strName As String: strName = 
Dim mbk As MediaBookmark
Set mbk = ActiveWindow.RangeFromPoint.MediaFormat.MediaBookmarks.Add(Position:=lngPosition, Name:=strName)

Arguments

The following arguments are required:

Position (Long) - The position of the MediaBookmark.

Name (String) - The name of the MediaBookmark.

MediaBookmarks.Count

Returns the number of bookmarks.

Start and end points are implicit bookmarks, but they should not be part of the MediaBookmarks collection.

Dim lngCount As Long
lngCount = ActiveWindow.RangeFromPoint.MediaFormat.MediaBookmarks.Count

MediaBookmarks.Item

Returns the specified MediaBookmark.

Syntax : expression.Item (Index)

Index: The position of the MediaBookmark.

Dim mbk As MediaBookmark
Set mbk = ActiveWindow.RangeFromPoint.MediaFormat.MediaBookmarks(Index:=1)