You see the little black spindle at the center, it has 3 locking tabs which will hold the CD in place.  With one hand support the other side (the bottom), put light pressure in the center of the CD against that little spindle until you hear snapping sound, it should hold the CD in place.
Attached Please see JPG of CD drive for OptiPlex 7040. I am unable to figure out how to install a CD into the drive. Please confirm if drive is as should be or parts missing e.g. a carriage for CD. Thank You Kindly [IMAGE]  
How to Install CD into Drive