How to select an element that is in a reference

I have an enumerator that holds elements both in a reference and in the current design file.

I need to selece certain elements, from either of the files I can select the ones in the current design file with;

ActiveModelReference.SelectElement oElement

 But when oElement is in a reference, I can't seem to select it. I have tried:

oElement.ModelReference.AsAttachment.SelectElement oElement

and various other combination, but they don't work.

Here's the latest permutation of my code (don't laugh):

If oElement.ModelReference.IsAttachment Then
    ActiveModelReference.Attachments(oElement.ModelReference.Name).SelectElement oElement
Else
    ActiveModelReference.SelectElement oElement
End If 

Thanks,

Graham