Returns an IHTMLElementCollection collection object that represents a collection of all EMBED elements in the current document. The EMBED element allows you to embed documents of any type within a document.
expression.embeds
expression Required. An expression that returns a DispFPHTMLDocument object.
The following example returns the EMBEDS collection and displays the number of elements in the document. If no elements exist, a message is displayed to the user.
Sub EmbedsInfo()
'Returns and displays information about
'the EMBEDS elements in the current document.
Dim objApp As FrontPage.Application
Dim objDoc As DispFPHTMLDocument
Dim objEmbeds As IHTMLElementCollection
Set objApp = FrontPage.Application
Set objDoc = objApp.ActiveDocument
Set objEmbeds = objDoc.embeds
'If there are EMBED elements
If objEmbeds.Length <> 0 Then
'If the length = 1
If objEmbeds.Length = 1 Then
MsgBox "There is only one " _
"embedded object in the current document."
Else
'If there are more than one
MsgBox "There are " & objEmbeds.Length - 1 & _
" embedded objects in the current document."
End If
Else
'Otherwise there are no embeds elements
MsgBox "There are no embedded objects " _
"in the current document."
End If
End Sub