Whilst it's possible to extract the content from embedded documents (see,
https://www.msofficeforums.com/150817-post2.html), it is not possible to retrieve the original filenames; only the filenames of linked objects can be retrieved. The only reason the code from your link worked is because someone had gone to the effort of including the original filenames in the images' Alternative Text property - a property embedded documents lack.