@serge wrote:
... ...
Strange... are linked Bitmaps objects not Space-independent?
...
Image inserted into drawing, just like any AcadEntity, is similar to block in AutoCAD: there is block definition (AcadBlock), which stays in block table, not visible; and there could be zero, or more block references (AcadBlockReference) being inserted ModelSpace or PaperSpaces. So, the image you are talking here is like acadBlockReference that can be inserted into ModelSpace, or PaperSpaces (Layouts). So, if you want to find all Images existing in a drawing, but not sure if they only in ModelSpace, or in one or more Layouts, then you need to search all layouts (including ModelSpace)
Obviously, when you do
For Each m_objBitmap in ActiveDocument.ModelSpace
...
Next
it ONLY searches/loops through ModelSpace.
To go through all Layouts (including "Model" layout - ModelSpace), you can simply loop through AcadLayouts collection, something like:
Dim lay As AcadLayout
Dim ent As AcadEntity
Dim img As AcadRasterImage
Dim count As Integer
For Each lay in ThisDrawing.Layouts
count=0
For Each ent In lay.Block
If TypeOf ent Is AcadRasterImager Then
Set img=ent
MsgBox "Found image: " & img.ImageFile
count = count + 1
End If
Next
MsgBox count & " image(s) found in layout """ & lay.Name & """"
Next
HTH