Save JPEG of non-active / non-visible part?

Hi

Does anyone know you can save a jpeg of a part without having the part open in its own window? The SaveAs4 command always seems to save a jpeg of the active window regardless of which document is specified.

Thanks

SolidworksApi macros