Type mismatch on Forall o In doc.EmbeddedObjects

I have a type mismatch in the follwing code

Forall o In doc.EmbeddedObjects ’ type mismatch

Messagebox( o.Name )

End Forall

i don’t undertand

i have copied the code from the help file

The document has EmbeddedObject

Subject: type mismatch on Forall o In doc.EmbeddedObjects

Did you also put in the check before your For loop to make sure the document does have embedded objects?

If doc.HasEmbedded Then

Forall o In doc.EmbeddedObjects

  Messagebox( o.Name )

End Forall

Else

Messagebox "No embedded objects found"

End If

That would prevent the type mismatch error.

Hope that helps.